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


C++ CScene类代码示例

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


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

示例1: Safe_Delete

void CSceneManager::ChangeScene()
{
	Safe_Delete(m_pCurScene);

	CScene* pScene = NULL;
	switch(m_eNextScene)
	{
	case STYPE_INIT:
		pScene = new CInitScene;
		break;
	case STYPE_EDIT:
		pScene = new CEditorScene;
		break;
	case STYPE_MAIN1:
		pScene = new CMainGameScene;
		break;
	}
	if(FAILED(pScene->Init()))
	{
		Safe_Delete(pScene);
		return;
	}

	m_pCurScene = pScene;
	m_pNextScene = NULL;
}
开发者ID:qiomoip,项目名称:space-express,代码行数:26,代码来源:SceneManager.cpp

示例2: CreateScene

void CSceneManager::CreateScene(const eSCENE_TYPE& eScene)
{
	CScene* pScene = NULL;
	switch(eScene)
	{
	case STYPE_INIT:
		pScene = new CInitScene;
		break;
	case STYPE_EDIT:
		pScene = new CEditorScene;
		break;
	case STYPE_MAIN1:
		pScene = new CMainGameScene;
		break;
	}
	if(FAILED(pScene->Init()))
	{
		Safe_Delete(pScene);
		return;
	}

	if(m_pCurScene)
	{
		Safe_Delete(m_pCurScene);
		m_pCurScene = pScene;
	}
	else
	{
		m_pCurScene = pScene;
	}
}
开发者ID:qiomoip,项目名称:space-express,代码行数:31,代码来源:SceneManager.cpp

示例3:

bool	CSceneControl::IsPrecedentScene(void){
	//	シーンあるんやろな?
	CScene* lpScene = m_vSceneFrame.m_lpScene;
	if (lpScene == NULL) return false;

	return lpScene->IsPrecedentScene();
}
开发者ID:mifumi323,项目名称:funya3_old,代码行数:7,代码来源:yaneScene.cpp

示例4: SetPosition

VOID CObject_Map::SetPosition(const fVector3& fvPosition) 
{ 
	//找到该物体所处的网格
	CScene* pActiveScene = (CScene*)CWorldManager::GetMe()->GetActiveScene();
	if(pActiveScene)
	{
		//当前有激活场景
		m_ivGridPos.x = (INT)pActiveScene->GetZoneX(fvPosition.x);
		m_ivGridPos.y = (INT)pActiveScene->GetZoneZ(fvPosition.z);

		//是否是UI模型
		if(!GetFakeObjectFlag()) 
		{
			//如果已经有注册过的网格,首先反注册
			if(m_pZone)
				m_pZone->UnRegisterObject(this);

			//注册到新网格上
			CZone* pZone = pActiveScene->GetZone(m_ivGridPos.x, m_ivGridPos.y);
			if(!pZone || pZone == m_pZone) return;
			pZone->RegisterObject(this);
		}
	}

	CObject::SetPosition( fvPosition );
}
开发者ID:brock7,项目名称:TianLong,代码行数:26,代码来源:Obj_Map.cpp

示例5: update

void CUnit::update()
{
    CAnimationObject::update();

    CScene *scene = CScene::sharedScene();
    CLandscape *landscape = scene->getLandscape();

    pos[2] = landscape->getHeight(pos[0],pos[1]);

    if(currState==NULL)
        return;

    if(currState!=nextState)
    {
        if(currState->end())
        {
            currState = nextState;
            currState->start();
        }
    }
    else
    {
       currState->update();
    }
}
开发者ID:Tiikara,项目名称:RTS-3D,代码行数:25,代码来源:cunit.cpp

示例6: ExitSceneOnOkCb

void CMessageBoxScene::ExitSceneOnOkCb(int result, void* usr)
{
	if (result)	// ok
	{
		CScene* self = (CScene*)(usr);
		self->ExitScene();	// ending
	}
}
开发者ID:crystalised,项目名称:GDEV,代码行数:8,代码来源:MessageBoxScene.cpp

示例7: CloseWinOnOkCb

void CMessageBoxScene::CloseWinOnOkCb(int result, void* usr)
{
	if (result)	//ok
	{
		CScene* self = (CScene*)(usr);
		self->GetEngine()->CloseWin();	// ending everything
	}
}
开发者ID:crystalised,项目名称:GDEV,代码行数:8,代码来源:MessageBoxScene.cpp

示例8: KLU_Log

// 计算从开始点到结束点的路径 2006-4-17
BOOL CPath::CreateMovePath(const fVector2& fvCurrent, const fVector2& fvTarget)
{      
	KLU_Log("Begin CreateMovePath : %f,%f,%f,%f", fvCurrent.x, fvCurrent.y,
		fvTarget.x, fvTarget.y);

	m_vPosStack.clear();

	CScene* pActiveScene = (CScene*)CWorldManager::GetMe()->GetActiveScene();

	if( pActiveScene == NULL ) 
		return FALSE;

	if( FALSE == pActiveScene->IsValidPosition(fvCurrent) )
		KLThrow("CPath::CreateMovePath() current position is invalid : %f,%f", fvCurrent.x, fvCurrent.y);

	if( FALSE == pActiveScene->IsValidPosition(fvTarget) )
		KLThrow("CPath::CreateMovePath() target position is invalid : %f,%f", fvTarget.x, fvTarget.y);

	bool find = pActiveScene->mPathFinder->findPath(fvCurrent.x, fvCurrent.y, fvTarget.x, fvTarget.y);

	int pathCount = 0;

	if (find)
	{   
		size_t count = pActiveScene->mPathFinder->getNumPathPoints();

		pathCount = static_cast<int>(count);

		KLU_Log("CreateMovePath : %f,%f,%f,%f,%d,%s", fvCurrent.x, fvCurrent.y,
			fvTarget.x, fvTarget.y, pathCount, find ? "find" : "not find");

		if (count > 16)
		{
			KLU_Log("CreateMovePath : %f,%f,%f,%f,%d,path unit > 16", fvCurrent.x, fvCurrent.y,
				fvTarget.x, fvTarget.y, pathCount);
		}

		for (size_t i=0; i<count-1; ++i)
		{
			const PathLib::ResultPoint& point1 = pActiveScene->mPathFinder->getResultPoint(i);
			const PathLib::ResultPoint& point2 = pActiveScene->mPathFinder->getResultPoint(i+1);

			PathUnit pathUnit;

			pathUnit.fvStart.x = point1.x;
			pathUnit.fvStart.y = point1.y;

			pathUnit.fvTarget.x = point2.x;
			pathUnit.fvTarget.y = point2.y;
			m_vPosStack.push_back(pathUnit);
		}

	}

	return find;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:57,代码来源:Path.cpp

示例9: OnUpdate

BOOL CSceneManager::OnUpdate( UINT32 dwTick )
{
	for(SceneMap::iterator itor = m_mapSceneList.begin(); itor != m_mapSceneList.end(); ++itor)
	{
		CScene *pScene = itor->second;

		pScene->OnUpdate(dwTick);
	}

	return TRUE;
}
开发者ID:ylmbtm,项目名称:GameProject,代码行数:11,代码来源:SceneManager.cpp

示例10: pGetParent

void CMyCamera::RenderPass( int32 i_iPass )
{
	if( i_iPass == -1 || i_iPass == ePass_Lighting )
	{
		CScene *pScene = pGetParent()->pGetParent()->pGetScene();
		uint32 iNumLights = pScene->iGetNumLights();
		for( uint32 i = 0; i < iNumLights; ++i )
		{
			pScene->SetCurrentLight( i );
			pScene->Render( ePass_Lighting );
		}
	}
}
开发者ID:stephanreiter,项目名称:muli3d,代码行数:13,代码来源:mycamera.cpp

示例11: assert

	CBillboard::CBillboard(Logic::CEntity * entity)
	{
		assert(entity);
		CScene * scene = entity->getMap()->getScene();
		_billboardset = scene->getSceneMgr()->createBillboardSet();

		Logic::MAttachBillboard * m = new Logic::MAttachBillboard();
		m->setBillboardset(this);
		entity->emitMessage(m);

		Ogre::Billboard* billboard;
		billboard = _billboardset->createBillboard(0.0f,0.0f,0.0f);
	}
开发者ID:JOSE89,项目名称:DamnedSunset,代码行数:13,代码来源:Billboard.cpp

示例12:

CSceneManager::~CSceneManager()
{
	SceneMap::iterator itor = m_mapSceneList.begin();
	for(; itor != m_mapSceneList.end(); ++itor)
	{
		CScene *pScene = itor->second;
		if(pScene != NULL)
		{
			pScene->Uninit();
			delete pScene;
			pScene = NULL;
		}
	}
}
开发者ID:ylmbtm,项目名称:GameProject,代码行数:14,代码来源:SceneManager.cpp

示例13: IsPointInUnreachRegion

//
// 但前点是否在不可行走区域之内
//
BOOL CPath::IsPointInUnreachRegion(const fVector2& fvTarget)
{
	CScene* pActiveScene = (CScene*)CWorldManager::GetMe()->GetActiveScene();

	if( pActiveScene == NULL ) 
		return FALSE;

	//检测坐标是否非法
	if( FALSE == pActiveScene->IsValidPosition(fvTarget) )
		//     KLThrow("CPath::IsPointInUnreachRegion() target position is invalid : %f,%f", fvTarget.x, fvTarget.y);
		// 不抛异常,如果目标点非法,直接返回true
		return TRUE;

	unsigned int id;
	return pActiveScene->mPathFinder->isPointInRegion(fvTarget.x, fvTarget.y, id, 1);
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:19,代码来源:Path.cpp

示例14: switch

BOOL CSceneManager::OnCommandHandle(UINT16 wCommandID, UINT64 u64ConnID, CBufferHelper *pBufferHelper)
{
	BOOL bHandled = TRUE;

	switch(wCommandID)
	{
	case CMD_SVR_CREATE_SCENE_REQ:
		{
			OnCmdCreateSceneReq(wCommandID, u64ConnID, pBufferHelper);
		}
		break;
	case CMD_DISCONNECT_NOTIFY:
		{

		}
		break;
	default:
		{
			bHandled = FALSE;
		}
		break;
	}

	if(bHandled) //消息己经被处理
	{
		return TRUE;
	}

	PacketHeader *pPacketHeader = pBufferHelper->GetPacketHeader();
	if(pPacketHeader == NULL)
	{
		ASSERT_FAIELD;
		return FALSE;
	}

	CScene *pScene = GetSceneByID(pPacketHeader->dwSceneID);
	if(pScene == NULL)
	{
		ASSERT_FAIELD;

		return FALSE;
	}

	pScene->OnCommandHandle(wCommandID, u64ConnID, pBufferHelper);
		
	return TRUE;
}
开发者ID:ylmbtm,项目名称:GameProject,代码行数:47,代码来源:SceneManager.cpp

示例15: CreateScene

BOOL CSceneManager::CreateScene( UINT32 dwSceneID )
{
	CScene *pScene = new CScene;

	if(!pScene->Init(dwSceneID, -1000, 1000, -1000, 1000))
	{
		ASSERT_FAIELD;

		delete pScene;

		return FALSE;
	}

	m_mapSceneList.insert(std::make_pair(dwSceneID, pScene));

	return TRUE;
}
开发者ID:ylmbtm,项目名称:GameProject,代码行数:17,代码来源:SceneManager.cpp


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