From 004e4b396dafdf585d771c93e0772c2632eee274 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Sat, 22 Jan 2011 16:50:27 +0200 Subject: [PATCH] Changed: #1193 Code cleanup. --- code/nel/tools/3d/object_viewer_qt/src/configuration.cpp | 2 +- code/nel/tools/3d/object_viewer_qt/src/main_window.cpp | 4 ++-- code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp | 8 ++++---- .../object_viewer_qt/src/plugins/core/settings_dialog.cpp | 5 ++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp b/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp index 97f6a6378..93b94fcd0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp @@ -218,7 +218,7 @@ void CConfiguration::cfcbSearchPaths(NLMISC::CConfigFile::CVar &var) { uint varsize = var.size(); for (uint i = 0; i < varsize; ++i) - CPath::addSearchPath(var.asString(i), true, false); + CPath::addSearchPath(var.asString(i), false, false); } } /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp index 3695477a9..e68cfa44c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp @@ -105,7 +105,7 @@ CMainWindow::CMainWindow(QWidget *parent) connect(_mainTimer, SIGNAL(timeout()), this, SLOT(updateRender())); // timer->start(); // <- timeout 0 // it's heavy on cpu, though, when no 3d driver initialized :) - _mainTimer->start(20); // 25fps + _mainTimer->start(23); // 25fps _statusBarTimer = new QTimer(this); connect(_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar())); @@ -709,7 +709,7 @@ void CMainWindow::updateRender() if (_isGraphicsInitialized && !Modules::objView().getDriver()->isLost()) { // 01. Render Driver (background color) - Modules::objView().getDriver()->activate(); + //Modules::objView().getDriver()->activate(); Modules::objView().renderDriver(); // clear all buffers // 02. Render Sky (sky scene) diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp index 5f9ef5706..a00fecbde 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp @@ -264,10 +264,13 @@ bool CObjectViewer::loadMesh(const std::string &meshFileName, const std::string if (_Entities.count(fileName) != 0) return false; - CPath::addSearchPath(CFile::getPath(meshFileName)); + CPath::addSearchPath(CFile::getPath(meshFileName), false, false); // create instance of the mesh character UInstance Entity = _Scene->createInstance(meshFileName); + + // if we can't create entity, skip it + if (Entity.empty()) return false; CAABBox bbox; Entity.getShapeAABBox(bbox); @@ -277,9 +280,6 @@ bool CObjectViewer::loadMesh(const std::string &meshFileName, const std::string USkeleton Skeleton = _Scene->createSkeleton(skelFileName); - // if we can't create entity, skip it - if (Entity.empty()) return false; - // TODO: remade at typedef std::map CEntities; EIT eit = (_Entities.insert (make_pair (fileName, CEntity()))).first; CEntity &entity = (*eit).second; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp index acb8ca856..9a43b68a9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp @@ -22,9 +22,6 @@ #include #include -namespace Core -{ - struct PageData { int index; @@ -34,6 +31,8 @@ struct PageData Q_DECLARE_METATYPE(PageData); +namespace Core +{ CSettingsDialog::CSettingsDialog(ExtensionSystem::IPluginManager *pluginManager, const QString &categoryId, const QString &pageId,