本文整理汇总了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;
}
示例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;
}
}
示例3:
bool CSceneControl::IsPrecedentScene(void){
// シーンあるんやろな?
CScene* lpScene = m_vSceneFrame.m_lpScene;
if (lpScene == NULL) return false;
return lpScene->IsPrecedentScene();
}
示例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 );
}
示例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();
}
}
示例6: ExitSceneOnOkCb
void CMessageBoxScene::ExitSceneOnOkCb(int result, void* usr)
{
if (result) // ok
{
CScene* self = (CScene*)(usr);
self->ExitScene(); // ending
}
}
示例7: CloseWinOnOkCb
void CMessageBoxScene::CloseWinOnOkCb(int result, void* usr)
{
if (result) //ok
{
CScene* self = (CScene*)(usr);
self->GetEngine()->CloseWin(); // ending everything
}
}
示例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;
}
示例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;
}
示例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 );
}
}
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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;
}
示例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;
}