mirror of https://github.com/Poikilos/b3view
parent
5b0dcc46dc
commit
54ff9333e2
|
@ -158,40 +158,42 @@ void UserInterface::displayLoadTextureDialog()
|
|||
|
||||
void UserInterface::handleMenuItemPressed( IGUIContextMenu *menu )
|
||||
{
|
||||
s32 id = menu->getItemCommandId( menu->getSelectedItem() );
|
||||
s32 selected = menu->getSelectedItem();
|
||||
if (selected > -1) {
|
||||
s32 id = menu->getItemCommandId(static_cast<u32>(selected));
|
||||
|
||||
switch( id )
|
||||
{
|
||||
case UIC_FILE_LOAD:
|
||||
displayLoadFileDialog();
|
||||
break;
|
||||
switch( id )
|
||||
{
|
||||
case UIC_FILE_LOAD:
|
||||
displayLoadFileDialog();
|
||||
break;
|
||||
|
||||
case UIC_FILE_LOAD_TEXTURE:
|
||||
displayLoadTextureDialog();
|
||||
break;
|
||||
case UIC_FILE_LOAD_TEXTURE:
|
||||
displayLoadTextureDialog();
|
||||
break;
|
||||
|
||||
case UIC_FILE_QUIT:
|
||||
m_Engine->m_RunEngine = false;
|
||||
break;
|
||||
case UIC_FILE_QUIT:
|
||||
m_Engine->m_RunEngine = false;
|
||||
break;
|
||||
|
||||
case UIC_VIEW_WIREFRAME:
|
||||
m_WireframeDisplay = viewMenu->isItemChecked(INDEX_VIEW_WIREFRAME_MESH);
|
||||
m_Engine->setMeshDisplayMode(m_WireframeDisplay, m_Lighting, m_TextureInterpolation);
|
||||
break;
|
||||
case UIC_VIEW_WIREFRAME:
|
||||
m_WireframeDisplay = viewMenu->isItemChecked(INDEX_VIEW_WIREFRAME_MESH);
|
||||
m_Engine->setMeshDisplayMode(m_WireframeDisplay, m_Lighting, m_TextureInterpolation);
|
||||
break;
|
||||
|
||||
case UIC_VIEW_LIGHTING:
|
||||
m_Lighting = viewMenu->isItemChecked(INDEX_VIEW_LIGHTING);
|
||||
m_Engine->setMeshDisplayMode(m_WireframeDisplay, m_Lighting, m_TextureInterpolation);
|
||||
break;
|
||||
case UIC_VIEW_LIGHTING:
|
||||
m_Lighting = viewMenu->isItemChecked(INDEX_VIEW_LIGHTING);
|
||||
m_Engine->setMeshDisplayMode(m_WireframeDisplay, m_Lighting, m_TextureInterpolation);
|
||||
break;
|
||||
|
||||
case UIC_VIEW_TEXTURE_INTERPOLATION:
|
||||
m_TextureInterpolation = viewMenu->isItemChecked(INDEX_VIEW_TEXTURE_INTERPOLATION);
|
||||
m_Engine->setMeshDisplayMode(m_WireframeDisplay, m_Lighting, m_TextureInterpolation);
|
||||
break;
|
||||
case UIC_VIEW_TEXTURE_INTERPOLATION:
|
||||
m_TextureInterpolation = viewMenu->isItemChecked(INDEX_VIEW_TEXTURE_INTERPOLATION);
|
||||
m_Engine->setMeshDisplayMode(m_WireframeDisplay, m_Lighting, m_TextureInterpolation);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// PUBLIC
|
||||
|
|
12
Utils.cpp
12
Utils.cpp
|
@ -37,7 +37,7 @@ void Utility::dumpMeshInfoToConsole( IAnimatedMeshSceneNode *node )
|
|||
|
||||
debug() << "[MESH]: # of frames : " << mesh->getFrameCount() << endl;
|
||||
debug() << "[MESH]: # of materials : " << node->getMaterialCount() << endl;
|
||||
for( int matIndex = 0; matIndex < node->getMaterialCount(); matIndex ++ )
|
||||
for( irr::u32 matIndex = 0; matIndex < node->getMaterialCount(); matIndex ++ )
|
||||
{
|
||||
debug() << "[MESH]: Material # " << matIndex << endl;
|
||||
const SMaterial &material = node->getMaterial( matIndex );
|
||||
|
@ -47,7 +47,7 @@ void Utility::dumpMeshInfoToConsole( IAnimatedMeshSceneNode *node )
|
|||
|
||||
// check for # textures
|
||||
int textures = 0;
|
||||
for( int ti = 0; ti < MATERIAL_MAX_TEXTURES; ti ++ )
|
||||
for( irr::u32 ti = 0; ti < MATERIAL_MAX_TEXTURES; ti ++ )
|
||||
if( material.getTexture( ti ) != nullptr ) textures ++;
|
||||
debug() << "[MESH]: # of textures : " << textures << endl;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ std::wstring Utility::parentOfPath(const wstring &path)
|
|||
else {
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"/");
|
||||
if (lastSlashPos == std::wstring::npos) {
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"\\");
|
||||
lastSlashPos = path.find_last_of(L"\\");
|
||||
}
|
||||
if (lastSlashPos != std::wstring::npos) {
|
||||
ret = path.substr(0, lastSlashPos);
|
||||
|
@ -76,7 +76,7 @@ wstring Utility::basename(const wstring &path)
|
|||
std::wstring ret = path;
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"/");
|
||||
if (lastSlashPos == std::wstring::npos) {
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"\\");
|
||||
lastSlashPos = path.find_last_of(L"\\");
|
||||
}
|
||||
if (lastSlashPos != std::wstring::npos) {
|
||||
ret = path.substr(lastSlashPos+1);
|
||||
|
@ -91,7 +91,7 @@ wstring Utility::withoutExtension(const wstring &path)
|
|||
if (lastDotPos != std::wstring::npos) {
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"/");
|
||||
if (lastSlashPos == std::wstring::npos) {
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"\\");
|
||||
lastSlashPos = path.find_last_of(L"\\");
|
||||
}
|
||||
if (lastSlashPos != std::wstring::npos) {
|
||||
if (lastDotPos > lastSlashPos) ret = path.substr(0, lastDotPos);
|
||||
|
@ -108,7 +108,7 @@ wstring Utility::extensionOf(const wstring &path)
|
|||
if (lastDotPos != std::wstring::npos) {
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"/");
|
||||
if (lastSlashPos == std::wstring::npos) {
|
||||
std::wstring::size_type lastSlashPos = path.find_last_of(L"\\");
|
||||
lastSlashPos = path.find_last_of(L"\\");
|
||||
}
|
||||
if (lastSlashPos != std::wstring::npos) {
|
||||
if (lastDotPos > lastSlashPos) ret = path.substr(lastDotPos + 1);
|
||||
|
|
Loading…
Reference in New Issue