当前位置: 首页>>代码示例>>C++>>正文


C++ Active函数代码示例

本文整理汇总了C++中Active函数的典型用法代码示例。如果您正苦于以下问题:C++ Active函数的具体用法?C++ Active怎么用?C++ Active使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Active函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: locker

void OSMutexRW::LockWrite()
{
    OSMutexLocker locker(&fInternalLock);
    AddWriteWaiter();       //  1 writer queued            
#if DEBUGMUTEXRW

    if (Active()) 
    {   qtss_printf("LockWrite(conflict) state = %d active readers = %d, waiting writers = %d, waiting readers=%d\n", fState, fActiveReaders, fWriteWaiters, fReadWaiters);
        CountConflict(1);  
    }

    qtss_printf("LockWrite 'waiting' fState = %d locked active readers = %d, waiting writers = %d, waiting readers=%d\n",fState, fActiveReaders, fReadWaiters, fWriteWaiters);
#endif

    //while   (ActiveReaders())  // active readers
	while (Active())//modify by tex
	{       
        fWritersCond.Wait(&fInternalLock,OSMutexRW::eMaxWait);
    }

    RemoveWriteWaiter(); // remove from waiting writers
    SetState(OSMutexRW::eActiveWriterState);    // this is the active writer    
    fActiveReaders = fState; 
#if DEBUGMUTEXRW
//  qtss_printf("LockWrite 'locked' fState = %d locked active readers = %d, waiting writers = %d, waiting readers=%d\n",fState, fActiveReaders, fReadWaiters, fWriteWaiters);
#endif

}
开发者ID:sunfirefox,项目名称:tangramcom,代码行数:28,代码来源:OSMutexRW.cpp

示例2: switch

void MenuItem::Mouse(HWND hwnd, UINT uMsg, DWORD wParam, DWORD lParam)
{
    int i = 0;
    switch(uMsg)
    {
        case WM_MBUTTONUP:
            i = INVOKE_MID;
            break;

        case WM_RBUTTONUP:
            i = INVOKE_RIGHT;
            break;

        case WM_LBUTTONUP:
            i = INVOKE_LEFT;
            if (m_pMenu->m_dblClicked)
                i |= INVOKE_DBL;

            if (0x8000 & GetAsyncKeyState(VK_MENU))
            {
                if (i & INVOKE_DBL)
                    i = INVOKE_PROP;
                else
                    i = 0;
            }
            break;

        case WM_LBUTTONDBLCLK:
        case WM_LBUTTONDOWN:
        case WM_MBUTTONDOWN:
        case WM_RBUTTONDOWN:
            m_pMenu->set_capture(MENU_CAPT_ITEM);
            Active(1);
            break;

        case WM_MOUSEMOVE:
            if (m_pMenu->m_captureflg && hwnd != window_under_mouse())
            {
                // start drag operation on mouseleave
                m_pMenu->set_capture(0);
                i = INVOKE_DRAG;
                break;
            }
            Active(1);
            break;

        case WM_MOUSEWHEEL:
            m_pMenu->HideChild();
            Active(2);
            break;
    }

    if (i && m_bActive && false == m_bNOP)
        Invoke(i);
}
开发者ID:Jmos,项目名称:bbclean-xzero450,代码行数:55,代码来源:MenuItem.cpp

示例3: CommitActive

    void MasterEntity::PreFrame( bool paused )
    {
        if( m_Ready && !Active() )
            CommitActive();

        if( !paused )
            GameCall<void>( "GamePreFrame" );

        if( m_Controller.Exists() && Active() )
            m_Controller->PreFrame();
    }
开发者ID:rsk78n,项目名称:zoya,代码行数:11,代码来源:masterentity.cpp

示例4: switch

// Mouse command MOUSEMOVE, LB_PRESSED, ...
void MenuItem::Mouse(HWND hwnd, UINT uMsg, DWORD wParam, DWORD lParam)
{
	int i = 0;
	switch (uMsg)
	{
	case WM_MBUTTONUP:
		i = INVOKE_MID;
		break;

	case WM_RBUTTONUP:
		i = INVOKE_RIGHT;
		break;

	case WM_LBUTTONUP:
		i = INVOKE_LEFT;
		if (m_pMenu->m_dblClicked) i |= INVOKE_DBL;
		break;

	case WM_LBUTTONDBLCLK:
	case WM_LBUTTONDOWN:
	case WM_MBUTTONDOWN:
	case WM_RBUTTONDOWN:
		SetCapture(hwnd);

	case WM_MOUSEMOVE:
		Active(1);
		break;
	}

	if (i && m_bActive)// && 0 == m_isNOP)
	{
		Menu::g_DiscardMouseMoves = 5;
		Invoke(i);
	}
}
开发者ID:BackupTheBerlios,项目名称:boxcore,代码行数:36,代码来源:MenuItem.cpp

示例5: WriteLine

void DriverLog::WriteLine(LPCTSTR message, ...)
{
	if (!Active() || message == 0)
		return;

    m_cs.Enter();
    
    static TCHAR lineStart[512];
    int lineStartSize = _stprintf_s(lineStart, 512, _T("[%4d][%6d]"), ::GetCurrentThreadId(), ::GetTickCount() - startTick);
    WriteFileLog(lineStart, lineStartSize);

    va_list args;
    va_start( args, message );

    int characters = _vsctprintf(message, args);
    if (characters != -1) {
		DynamicArray<TCHAR> buffer(characters + 5);
        if(-1 != _vstprintf_s(buffer, characters + 5, message, args)) {
			WritePipeLog(buffer, characters);
            buffer[characters] = _T('\r');
            buffer[characters + 1] = _T('\n');
            WriteFileLog(buffer, characters + 2);
        }
    }
    
    m_cs.Leave();
}
开发者ID:devSolo,项目名称:partcover-fork,代码行数:27,代码来源:logging.cpp

示例6: ZGetGame

void ZModule_HealOverTime::BeginHeal(MMatchDamageType type, int nHealAmount, int numHeal, MMatchItemEffectId effectId, int nItemId)
{
	if (type != MMDT_HEAL && type != MMDT_REPAIR) { _ASSERT(0); return; }

	m_type.Set_CheckCrc(type);
	m_nEffectId = effectId;

	float fCurrTime = ZGetGame()->GetTime();

	m_fBeginTime.Set_CheckCrc(fCurrTime);

	m_fHeal.Set_CheckCrc((float)nHealAmount);
	m_numHealDesire.Set_CheckCrc(numHeal);
	m_numHealDone.Set_CheckCrc(0);

	if (!m_bOnHeal.Ref())
	{
		m_fNextHealTime.Set_CheckCrc(fCurrTime);
	}

	m_bOnHeal.Set_CheckCrc(true);
	m_nItemId = nItemId;

	Active();
}
开发者ID:MagistrAVSH,项目名称:node3d,代码行数:25,代码来源:ZModule_HealOverTime.cpp

示例7: RSKMAP_ITERATE_VALUE_NAMED

    void PhysicsBodyObject::SetActive( bool active )
    {
        if( active == Active() )
            return;

        rsk::ActiveObject::SetActive( active );
    //
    //  Encapsulate RSKMAP_ITERATE; duplicate them so only what's needed is run
        PhysicsWorld* world = gGame->GetWorld();
        if( active )
        {
            RSKMAP_ITERATE_VALUE_NAMED( m_Detectors, slot )
            {
                if( slot->active )
                {
                    world->AddBody( slot->area.Self() );
                    CommitDetectorActive( *slot, active );
                }
            }
            return;
        }

        if( world )
        {
            RSKMAP_ITERATE_VALUE_NAMED( m_Detectors, slot )
            {
                CommitDetectorActive( *slot, active );
                world->RemoveBody( slot->area->GetID() );
            }
            return;
        }
开发者ID:rsk78n,项目名称:zoya,代码行数:31,代码来源:physicsbody.cpp

示例8: HighQuality

/*
==================
FullscreenFX_DoubleVision::HighQuality
==================
*/
void FullscreenFX_DoubleVision::HighQuality() {
	int offset = fxman->GetPlayerView()->dvFinishTime - gameLocal.fast.time;
	float scale = offset * g_dvAmplitude.GetFloat();

	// for testing purposes
	if ( !Active() ) {
		static int test = 0;
		if ( test > 312 ) {
			test = 0;
		}

		offset = test++;
		scale = offset * g_dvAmplitude.GetFloat();
	}

	idPlayer * player = fxman->GetPlayer();

	if( player == NULL ) {
		return;
	}

	offset *= 2;		// crutch up for higher res

	// set the scale and shift
	if ( scale > 0.5f ) {
		scale = 0.5f;
	}
	float shift = scale * sin( sqrtf( (float)offset ) * g_dvFrequency.GetFloat() );
	shift = fabs( shift );

	// carry red tint if in berserk mode
	idVec4 color( 1.0f, 1.0f, 1.0f, 1.0f );
	if ( gameLocal.fast.time < player->inventory.powerupEndTime[ BERSERK ] ) {
		color.y = 0.0f;
		color.z = 0.0f;
	}

	if ( !common->IsMultiplayer() && gameLocal.fast.time < player->inventory.powerupEndTime[ HELLTIME ] || gameLocal.fast.time < player->inventory.powerupEndTime[ INVULNERABILITY ]) {
		color.y = 0.0f;
		color.z = 0.0f;
	}

	// uv coordinates
	float s0 = shift;
	float t0 = 1.0f;
	float s1 = 1.0f;
	float t1 = 0.0f;


	renderSystem->SetColor4( color.x, color.y, color.z, 1.0f );
	renderSystem->DrawStretchPic( 0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, s0, t0, s1, t1, material );

	renderSystem->SetColor4( color.x, color.y, color.z, 0.5f );
	s0 = 0.0f;
	t0 = 1.0f;
	s1 = ( 1.0-shift );
	t1 = 0.0f;

	renderSystem->DrawStretchPic( 0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, s0, t0, s1, t1, material );
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:65,代码来源:PlayerView.cpp

示例9: SetActive

void cVnsiOsd::SetActive(bool On)
{
  if (On != Active())
  {
    cOsd::SetActive(On);
    if (On)
    {
      // must clear all windows here to avoid flashing effects - doesn't work if done
      // in Flush() only for the windows that are actually used...
      for (int i = 0; i < MAXNUMWINDOWS; i++)
      {
        Cmd(VNSI_OSD_CLEAR, i);
      }
      if (GetBitmap(0)) // only flush here if there are already bitmaps
        Flush();
    }
    else if (shown)
    {
      for (int i = 0; GetBitmap(i); i++)
      {
        Cmd(VNSI_OSD_CLOSE, i);
      }
      shown = false;
    }
  }
}
开发者ID:AlwinEsch,项目名称:vdr-plugin-vnsiserver,代码行数:26,代码来源:vnsiosd.c

示例10: qDebug

void
IrcAbstractChannel::Incoming (const QString & message,
                         const QString & rawMessage)
{
  QString cooked = HtmlMangle::Anchorize (message, 
                         HtmlMangle::HttpExp(),
                         HtmlMangle::HtmlAnchor);
qDebug () << " cooked message " << cooked;
  QDateTime now = QDateTime::currentDateTime ();
  QString smalldate ("<span style=\"font-size:small\">"
                     "%1</span> %2");
  QString cookedLine;
  cookedLine.append ("<br>\n");
  cookedLine.append (smalldate
                          .arg (now.toString ("hh:mm:ss"))
                          .arg (cooked));
  cookedLog.append (cookedLine);
  UpdateCooked ();
  if (logging) {
    logFile.write (cookedLine.toUtf8());
    logFile.flush ();
  }
  CheckWatch (rawMessage.length() > 0 ? rawMessage : message);
  emit Active (this);
}
开发者ID:berndhs,项目名称:e6irc,代码行数:25,代码来源:irc-abstract-channel.cpp

示例11: switch

RefResult Composite::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, 
   PartID& partID, RefMessage message ) {
	switch (message) {
		case REFMSG_CHANGE:			
			if (paramDlg) 
				paramDlg->Invalidate();
			if (pblock->LastNotifyParamID() == comptex_tex && pblock->Count(comptex_tex) != subTex.Count())
				SetNumMaps(pblock->Count(comptex_tex));
			else if (pblock->LastNotifyParamID() == comptex_ons && pblock->Count(comptex_ons) != subTex.Count())
				SetNumMaps(pblock->Count(comptex_ons));
			DiscardTexHandles(); // DS 5/4/00
			ivalid.SetEmpty();
			if (paramDlg&&Active())
				paramDlg->ip->MtlChanged();
			break;
		
		case REFMSG_GET_PARAM_DIM:
			return REF_STOP; 
		
		case REFMSG_GET_PARAM_NAME: {
			GetParamName *gpn = (GetParamName*)partID;
			gpn->name= GetSubTexmapSlotName(gpn->index);			
			return REF_STOP; 
			}
		}
	return(REF_SUCCEED);
	}
开发者ID:2asoft,项目名称:xray,代码行数:27,代码来源:composit.cpp

示例12: Active

void
TMagnify::StartSave()
{
	fImageFrozenOnSave = Active();
	if (fImageFrozenOnSave)
		MakeActive(false);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:7,代码来源:Magnify.cpp

示例13: OnRender

void CScoreboard::OnRender()
{
	if(!Active())
		return;

	// if the score board is active, then we should clear the motd message aswell
	if(m_pClient->m_pMotd->IsActive())
		m_pClient->m_pMotd->Clear();


	float Width = 400*3.0f*Graphics()->ScreenAspect();
	float Height = 400*3.0f;

	Graphics()->MapScreen(0, 0, Width, Height);

	float w = 700.0f;

	if(m_pClient->m_Snap.m_pGameInfoObj)
	{
		if(!(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS))
			RenderScoreboard(Width/2-w/2, 150.0f, w, 0, 0);
		else
		{
			const char *pRedClanName = GetClanName(TEAM_RED);
			const char *pBlueClanName = GetClanName(TEAM_BLUE);

			if(m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER && m_pClient->m_Snap.m_pGameDataObj)
			{
				char aText[256];
				str_copy(aText, Localize("Draw!"), sizeof(aText));

				if(m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreRed > m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreBlue)
				{
					if(pRedClanName)
						str_format(aText, sizeof(aText), Localize("%s wins!"), pRedClanName);
					else
						str_copy(aText, Localize("Red team wins!"), sizeof(aText));
				}
				else if(m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreBlue > m_pClient->m_Snap.m_pGameDataObj->m_TeamscoreRed)
				{
					if(pBlueClanName)
						str_format(aText, sizeof(aText), Localize("%s wins!"), pBlueClanName);
					else
						str_copy(aText, Localize("Blue team wins!"), sizeof(aText));
				}

				float w = TextRender()->TextWidth(0, 86.0f, aText, -1);
				TextRender()->Text(0, Width/2-w/2, 39, 86.0f, aText, -1);
			}

			RenderScoreboard(Width/2-w-5.0f, 150.0f, w, TEAM_RED, pRedClanName ? pRedClanName : Localize("Red team"));
			RenderScoreboard(Width/2+5.0f, 150.0f, w, TEAM_BLUE, pBlueClanName ? pBlueClanName : Localize("Blue team"));
		}
	}

	RenderGoals(Width/2-w/2, 150+760+10, w);
	RenderSpectators(Width/2-w/2, 150+760+10+50+10, w);
	RenderRecordingNotification((Width/7)*4);
}
开发者ID:gclxry,项目名称:teeworlds,代码行数:59,代码来源:scoreboard.cpp

示例14: Activate

void cStreamdevStreamer::Activate(bool On) 
{
	if (On && !Active()) {
		Dprintf("activate streamer\n");
		m_Writer->Start();
		cThread::Start();
	}
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:8,代码来源:streamer.c

示例15: PrepareLua

int CScriptDebugger::PrepareLua(lua_State* l)
{
	// call this function immediatly before calling lua_pcall. 
	//returns index in stack for errorFunc
	if(!Active())return -1;

	m_nMode = DMOD_NONE;
	return m_lua->PrepareLua(l);
}
开发者ID:2asoft,项目名称:xray,代码行数:9,代码来源:script_debugger.cpp


注:本文中的Active函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。