本文整理汇总了C++中COperator::GetLayerHot方法的典型用法代码示例。如果您正苦于以下问题:C++ COperator::GetLayerHot方法的具体用法?C++ COperator::GetLayerHot怎么用?C++ COperator::GetLayerHot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COperator
的用法示例。
在下文中一共展示了COperator::GetLayerHot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnEvent
void CToolSetTileHeight::OnEvent(ip::CInputDevice::SEvent & event)
{
COperator * pOperator = CXFile::GetInstance()->GetOperator();
CTerrainMesh * pTerrainMesh = CXFile::GetInstance()->GetTerrainMesh();
switch ( event.eType )
{
case ip::EIET_KB_KEYUP:
{
// shrink brush
if ( event.dwData == DIK_MINUS )
{
if ( pOperator->GetBrushSize() > 1 ) pOperator->DecBrushSize();
}
// amplify brush
if ( event.dwData == DIK_EQUALS )
{
pOperator->IncBrushSize();
}
//switch(event.dwData)
//{
//case DIK_3:
// {
// pOperator->SetHeightType((COperator::ESET_HEIGHT_TYPE)((pOperator->GetHeightType() + 1) % pOperator->GetHeightTypeCount()));
// }
//break;
//case DIK_4:
// {
// pOperator->SetAxisType((COperator::EAXIS_TYPE)((pOperator->GetAxisType() + 1) % pOperator->GetAxisTypeCount()));
// }
//break;
//case DIK_5:
// {
// pOperator->SetWayType((COperator::ESET_WAY_TYPE)((pOperator->GetWayType() + 1) % pOperator->GetWayTypeCount()));
// }
//break;
//}
}
break;
case ip::EIET_MS_BTNUP :
case ip::EIET_MS_MOVE :
{
if ( ip::CInputDevice::GetInstance()->GetButtonState(MK_LBUTTON) )
{
DWORD dwTextureHandleHot = pOperator->GetTextureHandleHot();
DWORD dwLayerHot = pOperator->GetLayerHot();
CCmdSetVertexHeight * pCmd = new CCmdSetVertexHeight;
// set grids via brush size
if ( pOperator->GetGridIndexHot() != INVALID )
{
DWORD dwCnt = 4*pOperator->GetBrushSize()*pOperator->GetBrushSize();
DWORD dwGridIndex = pOperator->GetGridIndexHot() - pOperator->GetBrushSize() - pOperator->GetBrushSize() * pTerrainMesh->GetWidth();
for ( DWORD j = 0; j < dwCnt; j++)
{
if ( j )
{
if ( !(j % (2 * pOperator->GetBrushSize())) )
dwGridIndex += pTerrainMesh->GetWidth() - 2*pOperator->GetBrushSize() + 1;
else
++dwGridIndex;
}
// check for valid grid
if ( dwGridIndex < 0 || dwGridIndex > pTerrainMesh->GetDepth() * pTerrainMesh->GetWidth() )
{
continue;
}
CTerrainMesh::SGrid & grid = pTerrainMesh->GetGrid(dwGridIndex);
for ( int i = 0; i < 4; i++)
{
pCmd->AddVertex(grid.dwVertexIndex[i]);
}
}
}
CCmdMgr::GetInstance()->Do(pCmd);
}
}
break;
}
}