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


C++ GetRegion函数代码示例

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


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

示例1: ResetGMVisibility

void CUser::UserInOut(uint8 bType)
{
	if (GetRegion() == nullptr)
		return;

	Packet result;

	if (bType != INOUT_OUT)
		ResetGMVisibility();

	GetInOut(result, bType);

	if (bType == INOUT_OUT)
		GetRegion()->Remove(this);
	else
		GetRegion()->Add(this);

	SendToRegion(&result, this, GetEventRoom());

	if (bType == INOUT_OUT || !isBlinking())
	{
		result.Initialize(AG_USER_INOUT);
		result.SByte();
		result << bType << GetSocketID() << GetName() << m_curx << m_curz;
		Send_AIServer(&result);
	}
}
开发者ID:R3aLisT,项目名称:X-ShieldProject,代码行数:27,代码来源:CharacterMovementHandler.cpp

示例2: while

int ARegion::CanBeStartingCity( ARegionArray *pRA )
{
	if(type == R_OCEAN) return 0;
    if (!IsCoastal()) return 0;
    if (town && town->pop == 5000) return 0;

    int regs = 0;
    AList inlist;
    AList donelist;

    ARegionPtr * temp = new ARegionPtr;
    temp->ptr = this;
    inlist.Add(temp);

    while(inlist.Num()) {
        ARegionPtr * reg = (ARegionPtr *) inlist.First();
        for (int i=0; i<NDIRS; i++) {
            ARegion * r2 = reg->ptr->neighbors[i];
            if (!r2) continue;
            if (r2->type == R_OCEAN) continue;
            if (GetRegion(&inlist,r2->num)) continue;
            if (GetRegion(&donelist,r2->num)) continue;
            regs++;
            if (regs>20) return 1;
            ARegionPtr * temp = new ARegionPtr;
            temp->ptr = r2;
            inlist.Add(temp);
        }
        inlist.Remove(reg);
        donelist.Add(reg);
    }
    return 0;
}
开发者ID:nedbrek,项目名称:Atlantis,代码行数:33,代码来源:world.cpp

示例3: GetStringParam

double CScript::PlaySound(const char* CmdStr, char* retStr)
{
	CPlayer* pPlayer = dynamic_cast<CPlayer*>(p_SrcShape);
	if(!pPlayer || !m_pRegion)	return 0;

	char* strFile = GetStringParam(CmdStr, 0);
	int  nToAround = GetIntParam(CmdStr, 1);
	if (nToAround == ERROR_CODE)
	{
		nToAround = 0;
	}

	if (strFile)
	{
		CMessage msg(MSG_S2C_RGN_PLAYSOUND);
		msg.Add(strFile);
		//只发给自己
		if(nToAround == 0 && pPlayer)
			msg.SendToPlayer( pPlayer -> GetExID() );
		else
			msg.SendToAround((CServerRegion*)GetRegion(), pPlayer->GetTileX(), pPlayer->GetTileY());

		M_FREE( strFile, sizeof(char)*MAX_VAR_LEN );
	}
	return 1;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:26,代码来源:ClientViewFun.cpp

示例4: SetButtonState

void	TTabButtonGadget :: SetButtonState  ( TState  state )
   {
	register TState		previous = State ;


	TShapeButtonGadget :: SetButtonState ( state ) ;


	if  ( Overlap   &&  previous  !=  State )
	   {
		TGadget *		g   = NextGadget ( ) ;
		TTabButtonGadget *      tab = TYPESAFE_DOWNCAST ( g, TTabButtonGadget ) ;
		
		
		if  ( previous  ==  Down  &&  State  ==  Up )
		   {
			if  ( tab  &&  tab -> State  ==  Up )
			   {
				TRegion *	Region 	=  new  TRegion ( ) ;
				

				GetRegion ( * Region, OuterRegion ) ;
				tab -> SetIntersectionRegion ( Region ) ;
				tab -> Invalidate ( ) ;
			     }
		     }
	     }
      }	
开发者ID:wuthering-bytes,项目名称:cheops,代码行数:28,代码来源:TABBTN.CPP

示例5: DMM_MapMemory

/*
 *  ======== DMM_MapMemory ========
 *  Purpose:
 *      Add a mapping block to the reserved chunk. DMM assumes that this block
 *  will be mapped in the DSP/IVA's address space. DMM returns an error if a
 *  mapping overlaps another one. This function stores the info that will be
 *  required later while unmapping the block.
 */
DSP_STATUS DMM_MapMemory(struct DMM_OBJECT *hDmmMgr, u32 addr, u32 size)
{
	struct DMM_OBJECT *pDmmObj = (struct DMM_OBJECT *)hDmmMgr;
	struct MapPage *chunk;
	DSP_STATUS status = DSP_SOK;

	GT_3trace(DMM_debugMask, GT_ENTER,
		 "Entered DMM_MapMemory () hDmmMgr %x, "
		 "addr %x, size %x\n", hDmmMgr, addr, size);
	SYNC_EnterCS(pDmmObj->hDmmLock);
	/* Find the Reserved memory chunk containing the DSP block to
	 * be mapped */
	chunk = (struct MapPage *)GetRegion(addr);
	if (chunk != NULL) {
		/* Mark the region 'mapped', leave the 'reserved' info as-is */
		chunk->bMapped = true;
		chunk->MappedSize = (size/PG_SIZE_4K);
	} else
		status = DSP_ENOTFOUND;
	SYNC_LeaveCS(pDmmObj->hDmmLock);
	GT_2trace(DMM_debugMask, GT_4CLASS,
		 "Leaving DMM_MapMemory status %x, chunk %x\n",
		status, chunk);
	return status;
}
开发者ID:Racing1,项目名称:zeppelin_kernel,代码行数:33,代码来源:dmm.c

示例6: Default

void CSkinWin::OnSize(UINT nType, int cx, int cy)
{
    //Default();
    CWnd *pWnd = CWnd::FromHandle(m_hWnd);
    CRect wr;    
    Default();
    pWnd->GetWindowRect(wr);
    pWnd->Invalidate();
    OnNcPaint(0);
    
//     if ( m_bTrans )
//         SetWindowRgn( m_hWnd, GetRegion(wr.Width(), wr.Height() ), TRUE );
//     else
//         SetWindowRgn( m_hWnd, NULL, TRUE );

	if (m_bTrans) 
	{
		// The operating system does not make a copy of the region, 
		// so do not make any further function calls with this region handle, 
		// and do not close this region handle
		HRGN hrgn = GetRegion(wr.Width(), wr.Height());
		SetWindowRgn(m_hWnd, hrgn, TRUE);
		
		DeleteObject(hrgn);		//wyw
	}
	else
		SetWindowRgn(m_hWnd, NULL, TRUE);


}
开发者ID:jiangchengxu,项目名称:spreadtrum-w160,代码行数:30,代码来源:SkinWin.cpp

示例7: assert

ServerEntry SessionInfo::GetServerEntry() const 
{
    if (!HasServerEntry()) {
        assert(false);
        throw std::exception("SessionInfo::GetServerEntry(): !HasServerEntry()");
    }

    // It is sometimes the case that we know more about our current server than
    // is contained in m_serverEntry or in the ServerEntry in the registry. So
    // we'll construct a new ServerEntry with the best info we have.

    ServerEntry newServerEntry(
        GetServerAddress(), GetRegion(), GetWebPort(), 
        GetWebServerSecret(), GetWebServerCertificate(), 
        GetSSHPort(), GetSSHUsername(), GetSSHPassword(), 
        GetSSHHostKey(), GetSSHObfuscatedPort(), 
        GetSSHObfuscatedKey(),
        GetMeekObfuscatedKey(), GetMeekServerPort(),
        GetMeekCookieEncryptionPublicKey(),
        GetMeekFrontingDomain(), GetMeekFrontingHost(),
        m_serverEntry.meekFrontingAddressesRegex,
        m_serverEntry.meekFrontingAddresses,
        m_serverEntry.capabilities);
    return newServerEntry;
}
开发者ID:projectarkc,项目名称:psiphon,代码行数:25,代码来源:sessioninfo.cpp

示例8: while

void CRegionView::OnCreatePrimitiveBox( )
{
	CStringDlg		dlg;
	BOOL			bOk;
	BOOL			bValidNumber;
	CReal			thickness;

	dlg.m_bAllowNumbers = TRUE;
	bOk = TRUE;
	bValidNumber = FALSE;
	
	uint32 nBoxThickness = ::GetApp()->GetOptions().GetDWordValue("DefaultBoxWidth", 128);

	dlg.m_EnteredText.Format( "%d", nBoxThickness );

	while( bOk && !bValidNumber )
	{
		if( bOk = ( dlg.DoModal(IDS_NEWBRUSHCAPTION, IDS_ENTERBRUSHTHICKNESS) == IDOK ))
		{
			thickness = (CReal)atoi( dlg.m_EnteredText );
			if( thickness > 0.0f )
				bValidNumber = TRUE;
			else
				AppMessageBox( IDS_ERROR_BRUSH_THICKNESS, MB_OK );
		}
	}
	
	if( bOk )
	{
		DoCreatePrimitiveBox( GetRegion( )->m_vMarker, thickness );
		::GetApp()->GetOptions().SetDWordValue("DefaultBoxWidth", (DWORD)thickness);
	}
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:33,代码来源:CreatePrimitive.cpp

示例9: GetRegion

bool MeaCircleTool::HasRegion()
{
    // There is always a rectangular region unless
    // the center and perimeter are coincident.
    //
    CRect rect = GetRegion();
    return (rect.Height() != 0) && (rect.Width() != 0);
}
开发者ID:craigshaw,项目名称:Meazure,代码行数:8,代码来源:CircleTool.cpp

示例10: GetSelectedGame

void GameList::OpenGCSaveFolder()
{
  const auto game = GetSelectedGame();
  if (!game)
    return;

  bool found = false;

  for (int i = 0; i < 2; i++)
  {
    QUrl url;
    switch (SConfig::GetInstance().m_EXIDevice[i])
    {
    case ExpansionInterface::EXIDEVICE_MEMORYCARDFOLDER:
    {
      std::string path = StringFromFormat("%s/%s/%s", File::GetUserPath(D_GCUSER_IDX).c_str(),
                                          SConfig::GetDirectoryForRegion(game->GetRegion()),
                                          i == 0 ? "Card A" : "Card B");

      std::string override_path = i == 0 ? Config::Get(Config::MAIN_GCI_FOLDER_A_PATH_OVERRIDE) :
                                           Config::Get(Config::MAIN_GCI_FOLDER_B_PATH_OVERRIDE);

      if (!override_path.empty())
        path = override_path;

      QDir dir(QString::fromStdString(path));

      if (!dir.entryList({QStringLiteral("%1-%2-*.gci")
                              .arg(QString::fromStdString(game->GetMakerID()))
                              .arg(QString::fromStdString(game->GetGameID().substr(0, 4)))})
               .empty())
      {
        url = QUrl::fromLocalFile(dir.absolutePath());
      }
      break;
    }
    case ExpansionInterface::EXIDEVICE_MEMORYCARD:
      std::string memcard_path = i == 0 ? Config::Get(Config::MAIN_MEMCARD_A_PATH) :
                                          Config::Get(Config::MAIN_MEMCARD_B_PATH);

      std::string memcard_dir;

      SplitPath(memcard_path, &memcard_dir, nullptr, nullptr);
      url = QUrl::fromLocalFile(QString::fromStdString(memcard_dir));
      break;
    }

    found |= !url.isEmpty();

    if (!url.isEmpty())
      QDesktopServices::openUrl(url);
  }

  if (!found)
    ModalMessageBox::information(this, tr("Information"), tr("No save data found."));
}
开发者ID:booto,项目名称:dolphin,代码行数:56,代码来源:GameList.cpp

示例11: DrawFocus

void CHTMLSectionLink::DrawFocus( GS::CDrawContext &dc )
{
	HRGN rgn;
	if( m_pParent->IsFocused() && GetRegion( rgn ) )
	{
		dc.DrawFocus( rgn );

		VAPI( DeleteObject( rgn ) );
	}
}
开发者ID:F5000,项目名称:spree,代码行数:10,代码来源:htmlsectionlink.cpp

示例12: GetRegion

 Region * Planet::GetRegion(Vector3 vec, int level){
     if(_sub!=NULL){
         for (int i = 0; i < 6; ++i)
         {
             if(_sub[i]!=NULL && _sub[i]->InsideRegion(vec))
                 return GetRegion(_sub[i],vec,level);
         }
     }
     return NULL;
 }
开发者ID:hdlopesrocha,项目名称:com.enter4ward,代码行数:10,代码来源:planet.cpp

示例13: GetRegion

Country VolumeGC::GetCountry(const Partition& partition) const
{
  // The 0 that we use as a default value is mapped to Country::Unknown and Region::Unknown
  const u8 country = ReadSwapped<u8>(3, partition).value_or(0);
  const Region region = GetRegion();

  if (CountryCodeToRegion(country, Platform::GameCubeDisc, region) != region)
    return TypicalCountryForRegion(region);

  return CountryCodeToCountry(country, Platform::GameCubeDisc, region);
}
开发者ID:MerryMage,项目名称:dolphin,代码行数:11,代码来源:VolumeGC.cpp

示例14: nsClientRect

already_AddRefed<nsClientRect>
nsDOMNotifyPaintEvent::BoundingClientRect()
{
    nsRefPtr<nsClientRect> rect = new nsClientRect(ToSupports(this));

    if (mPresContext) {
        rect->SetLayoutRect(GetRegion().GetBounds());
    }

    return rect.forget();
}
开发者ID:Jaxo,项目名称:releases-mozilla-central,代码行数:11,代码来源:nsDOMNotifyPaintEvent.cpp

示例15: ASSERT

/**
 * @brief	Executes the death action.
 *
 * @param	pKiller	The killer.
 */
void CNpc::OnDeath(Unit *pKiller)
{
	if (m_NpcState == NPC_DEAD)
		return;

	ASSERT(GetMap() != nullptr);
	ASSERT(GetRegion() != nullptr);

	m_NpcState = NPC_DEAD;

	if (m_byObjectType == SPECIAL_OBJECT)
	{
		_OBJECT_EVENT *pEvent = GetMap()->GetObjectEvent(GetEntryID());
		if (pEvent != nullptr)
			pEvent->byLife = 0;
	}

	Unit::OnDeath(pKiller);

	GetRegion()->Remove(TO_NPC(this));
	SetRegion();
}
开发者ID:TheNewbGuy,项目名称:snoxd-koserver,代码行数:27,代码来源:Npc.cpp


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