commit
af621187f1
@ -0,0 +1,81 @@
|
||||
# Locate Lua library
|
||||
# This module defines
|
||||
# LUA52_FOUND, if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES
|
||||
# LUA_INCLUDE_DIR, where to find lua.h
|
||||
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
# #include "lua.h"
|
||||
# and not
|
||||
# #include <lua/lua.h>
|
||||
# This is because, the lua location is not standardized and may exist
|
||||
# in locations other than lua/
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
find_path(LUA_INCLUDE_DIR lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua-5.2 include/lua include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
|
||||
find_library(LUA_LIBRARY
|
||||
NAMES lua52 lua5.2 lua-5.2 lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
|
||||
if(LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
if(UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else()
|
||||
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||
unset(lua_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
|
@ -1,191 +1,191 @@
|
||||
// Object Viewer Qt - Log Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Project includes
|
||||
#include "log_plugin.h"
|
||||
#include "log_settings_page.h"
|
||||
#include "qt_displayer.h"
|
||||
|
||||
#include "../core/icore.h"
|
||||
#include "../core/core_constants.h"
|
||||
#include "../core/menu_manager.h"
|
||||
#include "../../extension_system/iplugin_spec.h"
|
||||
|
||||
// Qt includes
|
||||
#include <QtCore/QObject>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QFile>
|
||||
#include <QDateTime>
|
||||
#include <QTextStream>
|
||||
|
||||
// NeL includes
|
||||
#include <nel/misc/debug.h>
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
|
||||
CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
}
|
||||
|
||||
CLogPlugin::~CLogPlugin()
|
||||
{
|
||||
Q_FOREACH(QObject *obj, m_autoReleaseObjects)
|
||||
{
|
||||
m_plugMan->removeObject(obj);
|
||||
}
|
||||
qDeleteAll(m_autoReleaseObjects);
|
||||
m_autoReleaseObjects.clear();
|
||||
|
||||
NLMISC::ErrorLog->removeDisplayer(m_displayer);
|
||||
NLMISC::WarningLog->removeDisplayer(m_displayer);
|
||||
NLMISC::DebugLog->removeDisplayer(m_displayer);
|
||||
NLMISC::AssertLog->removeDisplayer(m_displayer);
|
||||
NLMISC::InfoLog->removeDisplayer(m_displayer);
|
||||
delete m_displayer;
|
||||
}
|
||||
|
||||
bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString)
|
||||
{
|
||||
Q_UNUSED(errorString);
|
||||
m_plugMan = pluginManager;
|
||||
m_logSettingsPage = new CLogSettingsPage(this, this);
|
||||
addAutoReleasedObject(m_logSettingsPage);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CLogPlugin::extensionsInitialized()
|
||||
{
|
||||
setDisplayers();
|
||||
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::MenuManager *menuManager = core->menuManager();
|
||||
QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW);
|
||||
|
||||
QMainWindow *wnd = Core::ICore::instance()->mainWindow();
|
||||
wnd->addDockWidget(Qt::RightDockWidgetArea, this);
|
||||
hide();
|
||||
|
||||
viewMenu->addAction(this->toggleViewAction());
|
||||
}
|
||||
|
||||
void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
||||
{
|
||||
#ifdef NL_OS_WINDOWS
|
||||
// Ensure that a context doesn't exist yet.
|
||||
// This only applies to platforms without PIC, e.g. Windows.
|
||||
nlassert(!NLMISC::INelContext::isContextInitialised());
|
||||
#endif // fdef NL_OS_WINDOWS^M
|
||||
m_libContext = new NLMISC::CLibraryContext(*nelContext);
|
||||
|
||||
m_displayer = new NLQT::CQtDisplayer(m_ui.plainTextEdit);
|
||||
|
||||
}
|
||||
|
||||
QString CLogPlugin::name() const
|
||||
{
|
||||
return "LogPlugin";
|
||||
}
|
||||
|
||||
QString CLogPlugin::version() const
|
||||
{
|
||||
return "1.1";
|
||||
}
|
||||
|
||||
QString CLogPlugin::vendor() const
|
||||
{
|
||||
return "aquiles";
|
||||
}
|
||||
|
||||
QString CLogPlugin::description() const
|
||||
{
|
||||
return tr("DockWidget to display all log messages from NeL.");
|
||||
}
|
||||
|
||||
QStringList CLogPlugin::dependencies() const
|
||||
{
|
||||
QStringList list;
|
||||
list.append(Core::Constants::OVQT_CORE_PLUGIN);
|
||||
return list;
|
||||
}
|
||||
|
||||
void CLogPlugin::addAutoReleasedObject(QObject *obj)
|
||||
{
|
||||
m_plugMan->addObject(obj);
|
||||
m_autoReleaseObjects.prepend(obj);
|
||||
}
|
||||
|
||||
void CLogPlugin::setDisplayers()
|
||||
{
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
|
||||
settings->beginGroup(Core::Constants::LOG_SECTION);
|
||||
// Object Viewer Qt - Log Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Project includes
|
||||
#include "log_plugin.h"
|
||||
#include "log_settings_page.h"
|
||||
#include "qt_displayer.h"
|
||||
|
||||
#include "../core/icore.h"
|
||||
#include "../core/core_constants.h"
|
||||
#include "../core/menu_manager.h"
|
||||
#include "../../extension_system/iplugin_spec.h"
|
||||
|
||||
// Qt includes
|
||||
#include <QtCore/QObject>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QFile>
|
||||
#include <QDateTime>
|
||||
#include <QTextStream>
|
||||
|
||||
// NeL includes
|
||||
#include <nel/misc/debug.h>
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
|
||||
CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
}
|
||||
|
||||
CLogPlugin::~CLogPlugin()
|
||||
{
|
||||
Q_FOREACH(QObject *obj, m_autoReleaseObjects)
|
||||
{
|
||||
m_plugMan->removeObject(obj);
|
||||
}
|
||||
qDeleteAll(m_autoReleaseObjects);
|
||||
m_autoReleaseObjects.clear();
|
||||
|
||||
NLMISC::ErrorLog->removeDisplayer(m_displayer);
|
||||
NLMISC::WarningLog->removeDisplayer(m_displayer);
|
||||
NLMISC::DebugLog->removeDisplayer(m_displayer);
|
||||
NLMISC::AssertLog->removeDisplayer(m_displayer);
|
||||
NLMISC::InfoLog->removeDisplayer(m_displayer);
|
||||
delete m_displayer;
|
||||
}
|
||||
|
||||
bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString)
|
||||
{
|
||||
Q_UNUSED(errorString);
|
||||
m_plugMan = pluginManager;
|
||||
m_logSettingsPage = new CLogSettingsPage(this, this);
|
||||
addAutoReleasedObject(m_logSettingsPage);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CLogPlugin::extensionsInitialized()
|
||||
{
|
||||
setDisplayers();
|
||||
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::MenuManager *menuManager = core->menuManager();
|
||||
QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW);
|
||||
|
||||
QMainWindow *wnd = Core::ICore::instance()->mainWindow();
|
||||
wnd->addDockWidget(Qt::RightDockWidgetArea, this);
|
||||
hide();
|
||||
|
||||
viewMenu->addAction(this->toggleViewAction());
|
||||
}
|
||||
|
||||
void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
||||
{
|
||||
#ifdef NL_OS_WINDOWS
|
||||
// Ensure that a context doesn't exist yet.
|
||||
// This only applies to platforms without PIC, e.g. Windows.
|
||||
nlassert(!NLMISC::INelContext::isContextInitialised());
|
||||
#endif // fdef NL_OS_WINDOWS^M
|
||||
m_libContext = new NLMISC::CLibraryContext(*nelContext);
|
||||
|
||||
m_displayer = new NLQT::CQtDisplayer(m_ui.plainTextEdit);
|
||||
|
||||
}
|
||||
|
||||
QString CLogPlugin::name() const
|
||||
{
|
||||
return "LogPlugin";
|
||||
}
|
||||
|
||||
QString CLogPlugin::version() const
|
||||
{
|
||||
return "1.1";
|
||||
}
|
||||
|
||||
QString CLogPlugin::vendor() const
|
||||
{
|
||||
return "aquiles";
|
||||
}
|
||||
|
||||
QString CLogPlugin::description() const
|
||||
{
|
||||
return tr("DockWidget to display all log messages from NeL.");
|
||||
}
|
||||
|
||||
QStringList CLogPlugin::dependencies() const
|
||||
{
|
||||
QStringList list;
|
||||
list.append(Core::Constants::OVQT_CORE_PLUGIN);
|
||||
return list;
|
||||
}
|
||||
|
||||
void CLogPlugin::addAutoReleasedObject(QObject *obj)
|
||||
{
|
||||
m_plugMan->addObject(obj);
|
||||
m_autoReleaseObjects.prepend(obj);
|
||||
}
|
||||
|
||||
void CLogPlugin::setDisplayers()
|
||||
{
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
|
||||
settings->beginGroup(Core::Constants::LOG_SECTION);
|
||||
bool error = settings->value(Core::Constants::LOG_ERROR, true).toBool();
|
||||
bool warning = settings->value(Core::Constants::LOG_WARNING, true).toBool();
|
||||
bool debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool();
|
||||
bool assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool();
|
||||
bool info = settings->value(Core::Constants::LOG_INFO, true).toBool();
|
||||
settings->endGroup();
|
||||
|
||||
if (error) {
|
||||
if (!NLMISC::ErrorLog->attached(m_displayer))
|
||||
NLMISC::ErrorLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::ErrorLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (warning) {
|
||||
if (!NLMISC::WarningLog->attached(m_displayer))
|
||||
NLMISC::WarningLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::WarningLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (debug) {
|
||||
if (!NLMISC::DebugLog->attached(m_displayer))
|
||||
NLMISC::DebugLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::DebugLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (assert) {
|
||||
if (!NLMISC::AssertLog->attached(m_displayer))
|
||||
NLMISC::AssertLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::AssertLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (info) {
|
||||
if (!NLMISC::InfoLog->attached(m_displayer))
|
||||
NLMISC::InfoLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::InfoLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Q_EXPORT_PLUGIN(Plugin::CLogPlugin)
|
||||
bool info = settings->value(Core::Constants::LOG_INFO, true).toBool();
|
||||
settings->endGroup();
|
||||
|
||||
if (error) {
|
||||
if (!NLMISC::ErrorLog->attached(m_displayer))
|
||||
NLMISC::ErrorLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::ErrorLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (warning) {
|
||||
if (!NLMISC::WarningLog->attached(m_displayer))
|
||||
NLMISC::WarningLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::WarningLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (debug) {
|
||||
if (!NLMISC::DebugLog->attached(m_displayer))
|
||||
NLMISC::DebugLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::DebugLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (assert) {
|
||||
if (!NLMISC::AssertLog->attached(m_displayer))
|
||||
NLMISC::AssertLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::AssertLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
if (info) {
|
||||
if (!NLMISC::InfoLog->attached(m_displayer))
|
||||
NLMISC::InfoLog->addDisplayer(m_displayer);
|
||||
} else {
|
||||
if (m_displayer) {
|
||||
NLMISC::InfoLog->removeDisplayer(m_displayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Q_EXPORT_PLUGIN(Plugin::CLogPlugin)
|
||||
|
@ -1,133 +1,133 @@
|
||||
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Project includes
|
||||
#include "log_settings_page.h"
|
||||
#include "log_plugin.h"
|
||||
#include "../core/core_constants.h"
|
||||
#include "../core/icore.h"
|
||||
#include "../../extension_system/plugin_manager.h"
|
||||
|
||||
// NeL includes
|
||||
|
||||
// Qt includes
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Project includes
|
||||
#include "log_settings_page.h"
|
||||
#include "log_plugin.h"
|
||||
#include "../core/core_constants.h"
|
||||
#include "../core/icore.h"
|
||||
#include "../../extension_system/plugin_manager.h"
|
||||
|
||||
// NeL includes
|
||||
|
||||
// Qt includes
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
namespace ExtensionSystem
|
||||
{
|
||||
class IPluginManager;
|
||||
}
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
|
||||
class CLogPlugin;
|
||||
|
||||
CLogSettingsPage::CLogSettingsPage(CLogPlugin *logPlugin, QObject *parent)
|
||||
: IOptionsPage(parent),
|
||||
m_logPlugin(logPlugin),
|
||||
m_currentPage(NULL),
|
||||
class IPluginManager;
|
||||
}
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
|
||||
class CLogPlugin;
|
||||
|
||||
CLogSettingsPage::CLogSettingsPage(CLogPlugin *logPlugin, QObject *parent)
|
||||
: IOptionsPage(parent),
|
||||
m_logPlugin(logPlugin),
|
||||
m_currentPage(NULL),
|
||||
m_error(true),
|
||||
m_warning(true),
|
||||
m_debug(true),
|
||||
m_assert(true),
|
||||
m_info(true)
|
||||
{
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::id() const
|
||||
{
|
||||
return QLatin1String("log");
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::trName() const
|
||||
{
|
||||
return tr("Log");
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::category() const
|
||||
{
|
||||
return QLatin1String(Core::Constants::SETTINGS_CATEGORY_GENERAL);
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::trCategory() const
|
||||
{
|
||||
return tr(Core::Constants::SETTINGS_TR_CATEGORY_GENERAL);
|
||||
}
|
||||
|
||||
QIcon CLogSettingsPage::categoryIcon() const
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
QWidget *CLogSettingsPage::createPage(QWidget *parent)
|
||||
{
|
||||
m_currentPage = new QWidget(parent);
|
||||
m_ui.setupUi(m_currentPage);
|
||||
|
||||
readSettings();
|
||||
m_ui.errorCheck->setChecked(m_error);
|
||||
m_ui.warningCheck->setChecked(m_warning);
|
||||
m_ui.debugCheck->setChecked(m_debug);
|
||||
m_ui.assertCheck->setChecked(m_assert);
|
||||
m_ui.infoCheck->setChecked(m_info);
|
||||
|
||||
return m_currentPage;
|
||||
}
|
||||
|
||||
void CLogSettingsPage::apply()
|
||||
{
|
||||
m_error = m_ui.errorCheck->isChecked();
|
||||
m_warning = m_ui.warningCheck->isChecked();
|
||||
m_debug = m_ui.debugCheck->isChecked();
|
||||
m_assert = m_ui.assertCheck->isChecked();
|
||||
m_info = m_ui.infoCheck->isChecked();
|
||||
|
||||
writeSettings();
|
||||
m_logPlugin->setDisplayers();
|
||||
}
|
||||
|
||||
void CLogSettingsPage::readSettings()
|
||||
{
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
|
||||
settings->beginGroup(Core::Constants::LOG_SECTION);
|
||||
m_info(true)
|
||||
{
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::id() const
|
||||
{
|
||||
return QLatin1String("log");
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::trName() const
|
||||
{
|
||||
return tr("Log");
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::category() const
|
||||
{
|
||||
return QLatin1String(Core::Constants::SETTINGS_CATEGORY_GENERAL);
|
||||
}
|
||||
|
||||
QString CLogSettingsPage::trCategory() const
|
||||
{
|
||||
return tr(Core::Constants::SETTINGS_TR_CATEGORY_GENERAL);
|
||||
}
|
||||
|
||||
QIcon CLogSettingsPage::categoryIcon() const
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
QWidget *CLogSettingsPage::createPage(QWidget *parent)
|
||||
{
|
||||
m_currentPage = new QWidget(parent);
|
||||
m_ui.setupUi(m_currentPage);
|
||||
|
||||
readSettings();
|
||||
m_ui.errorCheck->setChecked(m_error);
|
||||
m_ui.warningCheck->setChecked(m_warning);
|
||||
m_ui.debugCheck->setChecked(m_debug);
|
||||
m_ui.assertCheck->setChecked(m_assert);
|
||||
m_ui.infoCheck->setChecked(m_info);
|
||||
|
||||
return m_currentPage;
|
||||
}
|
||||
|
||||
void CLogSettingsPage::apply()
|
||||
{
|
||||
m_error = m_ui.errorCheck->isChecked();
|
||||
m_warning = m_ui.warningCheck->isChecked();
|
||||
m_debug = m_ui.debugCheck->isChecked();
|
||||
m_assert = m_ui.assertCheck->isChecked();
|
||||
m_info = m_ui.infoCheck->isChecked();
|
||||
|
||||
writeSettings();
|
||||
m_logPlugin->setDisplayers();
|
||||
}
|
||||
|
||||
void CLogSettingsPage::readSettings()
|
||||
{
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
|
||||
settings->beginGroup(Core::Constants::LOG_SECTION);
|
||||
m_error = settings->value(Core::Constants::LOG_ERROR, true).toBool();
|
||||
m_warning = settings->value(Core::Constants::LOG_WARNING, true).toBool();
|
||||
m_debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool();
|
||||
m_assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool();
|
||||
m_info = settings->value(Core::Constants::LOG_INFO, true).toBool();
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
void CLogSettingsPage::writeSettings()
|
||||
{
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
|
||||
settings->beginGroup(Core::Constants::LOG_SECTION);
|
||||
settings->setValue(Core::Constants::LOG_ERROR, m_error);
|
||||
settings->setValue(Core::Constants::LOG_WARNING, m_warning);
|
||||
settings->setValue(Core::Constants::LOG_DEBUG, m_debug);
|
||||
settings->setValue(Core::Constants::LOG_ASSERT, m_assert);
|
||||
settings->setValue(Core::Constants::LOG_INFO, m_info);
|
||||
settings->endGroup();
|
||||
|
||||
settings->sync();
|
||||
}
|
||||
|
||||
m_info = settings->value(Core::Constants::LOG_INFO, true).toBool();
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
void CLogSettingsPage::writeSettings()
|
||||
{
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
|
||||
settings->beginGroup(Core::Constants::LOG_SECTION);
|
||||
settings->setValue(Core::Constants::LOG_ERROR, m_error);
|
||||
settings->setValue(Core::Constants::LOG_WARNING, m_warning);
|
||||
settings->setValue(Core::Constants::LOG_DEBUG, m_debug);
|
||||
settings->setValue(Core::Constants::LOG_ASSERT, m_assert);
|
||||
settings->setValue(Core::Constants::LOG_INFO, m_info);
|
||||
settings->endGroup();
|
||||
|
||||
settings->sync();
|
||||
}
|
||||
|
||||
} /* namespace Plugin */
|
@ -1,57 +1,57 @@
|
||||
#ifndef ZONE_PAINTER_MAIN_WINDOW_H
|
||||
#define ZONE_PAINTER_MAIN_WINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QAction>
|
||||
#include <QtGui/QUndoStack>
|
||||
|
||||
namespace NLQT {
|
||||
class QNLWidget;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ZonePainterMainWindow;
|
||||
}
|
||||
|
||||
class PainterDockWidget;
|
||||
|
||||
class ZonePainterMainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ZonePainterMainWindow(QWidget *parent = 0);
|
||||
~ZonePainterMainWindow();
|
||||
|
||||
void loadConfig();
|
||||
void saveConfig();
|
||||
QUndoStack *getUndoStack() { return m_undoStack; }
|
||||
public Q_SLOTS:
|
||||
#ifndef ZONE_PAINTER_MAIN_WINDOW_H
|
||||
#define ZONE_PAINTER_MAIN_WINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QAction>
|
||||
#include <QtGui/QUndoStack>
|
||||
|
||||
namespace NLQT {
|
||||
class QNLWidget;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ZonePainterMainWindow;
|
||||
}
|
||||
|
||||
class PainterDockWidget;
|
||||
|
||||
class ZonePainterMainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ZonePainterMainWindow(QWidget *parent = 0);
|
||||
~ZonePainterMainWindow();
|
||||
|
||||
void loadConfig();
|
||||
void saveConfig();
|
||||
QUndoStack *getUndoStack() { return m_undoStack; }
|
||||
public Q_SLOTS:
|
||||
void setToolMode(int value);
|
||||
void setToolMode();
|
||||
void updateStatusBar();
|
||||
void setBackgroundColor();
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *showEvent);
|
||||
virtual void hideEvent(QHideEvent *hideEvent);
|
||||
|
||||
private:
|
||||
Ui::ZonePainterMainWindow *ui;
|
||||
NLQT::QNLWidget *m_nelWidget;
|
||||
PainterDockWidget *m_painterDockWidget;
|
||||
QTimer *m_statusBarTimer;
|
||||
QLabel *m_statusInfo;
|
||||
|
||||
void setToolMode();
|
||||
void updateStatusBar();
|
||||
void setBackgroundColor();
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *showEvent);
|
||||
virtual void hideEvent(QHideEvent *hideEvent);
|
||||
|
||||
private:
|
||||
Ui::ZonePainterMainWindow *ui;
|
||||
NLQT::QNLWidget *m_nelWidget;
|
||||
PainterDockWidget *m_painterDockWidget;
|
||||
QTimer *m_statusBarTimer;
|
||||
QLabel *m_statusInfo;
|
||||
|
||||
QAction *_toolPaintModeAction;
|
||||
QAction *_toolFillModeAction;
|
||||
QAction *_toolSelectModeAction;
|
||||
QAction *_toolPickModeAction;
|
||||
QMenu *_toolModeMenu;
|
||||
QUndoStack *m_undoStack;
|
||||
//QAction *m_setBackColorAction;
|
||||
};
|
||||
|
||||
#endif // ZONE_PAINTER_MAIN_WINDOW_H
|
||||
QMenu *_toolModeMenu;
|
||||
QUndoStack *m_undoStack;
|
||||
//QAction *m_setBackColorAction;
|
||||
};
|
||||
|
||||
#endif // ZONE_PAINTER_MAIN_WINDOW_H
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,229 +1,229 @@
|
||||
/*
|
||||
Object Viewer Qt Widget
|
||||
Copyright (C) 2010 Adrian Jaekel <aj at elane2k dot com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OBJECT_VIEWER_WIDGET_H
|
||||
#define OBJECT_VIEWER_WIDGET_H
|
||||
|
||||
// STL includes
|
||||
|
||||
// Qt includes
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#include <QTimer>
|
||||
|
||||
// NeL includes
|
||||
#include <nel/misc/rgba.h>
|
||||
#include <nel/misc/aabbox.h>
|
||||
|
||||
// Project includes
|
||||
#include "entity.h"
|
||||
#include "interfaces.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
class UDriver;
|
||||
class UScene;
|
||||
class ULight;
|
||||
class UInstance;
|
||||
class UCamera;
|
||||
class USkeleton;
|
||||
class UPlayListManager;
|
||||
class U3dMouseListener;
|
||||
}
|
||||
|
||||
class QIcon;
|
||||
/**
|
||||
namespace NLQT
|
||||
@brief namespace NLQT
|
||||
*/
|
||||
namespace NLQT
|
||||
{
|
||||
class CObjectViewerWidget:
|
||||
public QWidget,
|
||||
public IObjectViewer
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(NLQT::IObjectViewer)
|
||||
|
||||
public:
|
||||
/// Default constructor.
|
||||
CObjectViewerWidget(QWidget *parent = 0);
|
||||
virtual ~CObjectViewerWidget();
|
||||
|
||||
virtual QPaintEngine* paintEngine() const { return NULL; }
|
||||
virtual void showEvent ( QShowEvent * event );
|
||||
|
||||
void setNelContext(NLMISC::INelContext &nelContext);
|
||||
|
||||
static CObjectViewerWidget &objViewWid() { return *_objectViewerWidget; }
|
||||
|
||||
/// Init a driver and create scene.
|
||||
void init();
|
||||
|
||||
/// Release class.
|
||||
void release();
|
||||
|
||||
/// Update mouse and keyboard events. And update camera matrix.
|
||||
void updateInput();
|
||||
|
||||
/// Render Driver (clear all buffers and set background color).
|
||||
void renderDriver();
|
||||
|
||||
/// Render current scene.
|
||||
void renderScene();
|
||||
|
||||
/// Render Debug 2D (stuff for dev).
|
||||
void renderDebug2D();
|
||||
|
||||
/// Make a screenshot of the current scene and save.
|
||||
void saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga);
|
||||
|
||||
/// Load a mesh or particle system and add to current scene.
|
||||
/// @param meshFileName - name loading shape or ps file.
|
||||
/// @param skelFileName - name loading skeletin file.
|
||||
/// @return true if file have been loaded, false if file have not been loaded.
|
||||
bool loadMesh (const std::string &meshFileName, const std::string &skelFileName);
|
||||
|
||||
/// Reset current scene.
|
||||
void resetScene();
|
||||
|
||||
/// Set the background color.
|
||||
/// @param backgroundColor - background color.
|
||||
void setBackgroundColor(NLMISC::CRGBA backgroundColor);
|
||||
|
||||
/// Set type driver.
|
||||
/// @param Direct3D - type driver (true - Direct3D) or (false -OpenGL)
|
||||
void setGraphicsDriver(bool Direct3D);
|
||||
|
||||
/// Set size viewport for correct set perspective
|
||||
/// @param w - width window.
|
||||
/// @param h - height window.
|
||||
void setSizeViewport(uint16 w, uint16 h);
|
||||
|
||||
void setBloomEffect(bool enabled) { _BloomEffect = enabled; }
|
||||
|
||||
/// Select instance from the scene
|
||||
/// @param name - name instance, "" if no instance edited
|
||||
void setCurrentObject(const std::string &name);
|
||||
|
||||
/// Get current instance from the scene
|
||||
/// @return name current instance, "" if no instance edited
|
||||
const std::string& getCurrentObject() { return _CurrentInstance; }
|
||||
|
||||
/// Get entity from the scene
|
||||
/// @return ref Entity
|
||||
CEntity& getEntity(const std::string &name);
|
||||
|
||||
/// Get full list instances from the scene
|
||||
/// @param listObj - ref of return list instances
|
||||
void getListObjects(std::vector<std::string> &listObj);
|
||||
|
||||
/// Get value background color.
|
||||
/// @return background color.
|
||||
NLMISC::CRGBA getBackgroundColor() { return _BackgroundColor; }
|
||||
|
||||
/// Get type driver.
|
||||
/// @return true if have used Direct3D driver, false OpenGL driver.
|
||||
inline bool getDirect3D() { return _Direct3D; }
|
||||
|
||||
inline bool getBloomEffect() const { return _BloomEffect; }
|
||||
|
||||
/// Get a pointer to the driver.
|
||||
/// @return pointer to the driver.
|
||||
inline NL3D::UDriver *getDriver() { return _Driver; }
|
||||
|
||||
/// Get a pointer to the scene.
|
||||
/// @return pointer to the scene.
|
||||
inline NL3D::UScene *getScene() { return _Scene; }
|
||||
|
||||
/// Get a manager of playlist
|
||||
/// @return pointer to the UPlayListManager
|
||||
inline NL3D::UPlayListManager *getPlayListManager() { return _PlayListManager; }
|
||||
|
||||
void setCamera(NL3D::UScene *scene, NLMISC::CAABBox &bbox, NL3D::UTransform &entity, bool high_z=false);
|
||||
bool setupLight(const NLMISC::CVector &position, const NLMISC::CVector &direction);
|
||||
|
||||
QIcon* saveOneImage(std::string shapename);
|
||||
|
||||
virtual void setVisible(bool visible);
|
||||
|
||||
QWidget* getWidget() {return this;}
|
||||
|
||||
virtual QString name() const {return ("ObjectViewerWidget");}
|
||||
|
||||
protected:
|
||||
#if defined(NL_OS_WINDOWS)
|
||||
virtual bool winEvent(MSG * message, long * result);
|
||||
#elif defined(NL_OS_MAC)
|
||||
virtual bool macEvent(EventHandlerCallRef caller, EventRef event);
|
||||
#elif defined(NL_OS_UNIX)
|
||||
virtual bool x11Event(XEvent *event);
|
||||
#endif
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateRender();
|
||||
|
||||
private:
|
||||
/*
|
||||
Object Viewer Qt Widget
|
||||
Copyright (C) 2010 Adrian Jaekel <aj at elane2k dot com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OBJECT_VIEWER_WIDGET_H
|
||||
#define OBJECT_VIEWER_WIDGET_H
|
||||
|
||||
// STL includes
|
||||
|
||||
// Qt includes
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#include <QTimer>
|
||||
|
||||
// NeL includes
|
||||
#include <nel/misc/rgba.h>
|
||||
#include <nel/misc/aabbox.h>
|
||||
|
||||
// Project includes
|
||||
#include "entity.h"
|
||||
#include "interfaces.h"
|
||||
|
||||
namespace NL3D
|
||||
{
|
||||
class UDriver;
|
||||
class UScene;
|
||||
class ULight;
|
||||
class UInstance;
|
||||
class UCamera;
|
||||
class USkeleton;
|
||||
class UPlayListManager;
|
||||
class U3dMouseListener;
|
||||
}
|
||||
|
||||
class QIcon;
|
||||
/**
|
||||
namespace NLQT
|
||||
@brief namespace NLQT
|
||||
*/
|
||||
namespace NLQT
|
||||
{
|
||||
class CObjectViewerWidget:
|
||||
public QWidget,
|
||||
public IObjectViewer
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(NLQT::IObjectViewer)
|
||||
|
||||
public:
|
||||
/// Default constructor.
|
||||
CObjectViewerWidget(QWidget *parent = 0);
|
||||
virtual ~CObjectViewerWidget();
|
||||
|
||||
virtual QPaintEngine* paintEngine() const { return NULL; }
|
||||
virtual void showEvent ( QShowEvent * event );
|
||||
|
||||
void setNelContext(NLMISC::INelContext &nelContext);
|
||||
|
||||
static CObjectViewerWidget &objViewWid() { return *_objectViewerWidget; }
|
||||
|
||||
/// Init a driver and create scene.
|
||||
void init();
|
||||
|
||||
/// Release class.
|
||||
void release();
|
||||
|
||||
/// Update mouse and keyboard events. And update camera matrix.
|
||||
void updateInput();
|
||||
|
||||
/// Render Driver (clear all buffers and set background color).
|
||||
void renderDriver();
|
||||
|
||||
/// Render current scene.
|
||||
void renderScene();
|
||||
|
||||
/// Render Debug 2D (stuff for dev).
|
||||
void renderDebug2D();
|
||||
|
||||
/// Make a screenshot of the current scene and save.
|
||||
void saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga);
|
||||
|
||||
/// Load a mesh or particle system and add to current scene.
|
||||
/// @param meshFileName - name loading shape or ps file.
|
||||
/// @param skelFileName - name loading skeletin file.
|
||||
/// @return true if file have been loaded, false if file have not been loaded.
|
||||
bool loadMesh (const std::string &meshFileName, const std::string &skelFileName);
|
||||
|
||||
/// Reset current scene.
|
||||
void resetScene();
|
||||
|
||||
/// Set the background color.
|
||||
/// @param backgroundColor - background color.
|
||||
void setBackgroundColor(NLMISC::CRGBA backgroundColor);
|
||||
|
||||
/// Set type driver.
|
||||
/// @param Direct3D - type driver (true - Direct3D) or (false -OpenGL)
|
||||
void setGraphicsDriver(bool Direct3D);
|
||||
|
||||
/// Set size viewport for correct set perspective
|
||||
/// @param w - width window.
|
||||
/// @param h - height window.
|
||||
void setSizeViewport(uint16 w, uint16 h);
|
||||
|
||||
void setBloomEffect(bool enabled) { _BloomEffect = enabled; }
|
||||
|
||||
/// Select instance from the scene
|
||||
/// @param name - name instance, "" if no instance edited
|
||||
void setCurrentObject(const std::string &name);
|
||||
|
||||
/// Get current instance from the scene
|
||||
/// @return name current instance, "" if no instance edited
|
||||
const std::string& getCurrentObject() { return _CurrentInstance; }
|
||||
|
||||
/// Get entity from the scene
|
||||
/// @return ref Entity
|
||||
CEntity& getEntity(const std::string &name);
|
||||
|
||||
/// Get full list instances from the scene
|
||||
/// @param listObj - ref of return list instances
|
||||
void getListObjects(std::vector<std::string> &listObj);
|
||||
|
||||
/// Get value background color.
|
||||
/// @return background color.
|
||||
NLMISC::CRGBA getBackgroundColor() { return _BackgroundColor; }
|
||||
|
||||
/// Get type driver.
|
||||
/// @return true if have used Direct3D driver, false OpenGL driver.
|
||||
inline bool getDirect3D() { return _Direct3D; }
|
||||
|
||||
inline bool getBloomEffect() const { return _BloomEffect; }
|
||||
|
||||
/// Get a pointer to the driver.
|
||||
/// @return pointer to the driver.
|
||||
inline NL3D::UDriver *getDriver() { return _Driver; }
|
||||
|
||||
/// Get a pointer to the scene.
|
||||
/// @return pointer to the scene.
|
||||
inline NL3D::UScene *getScene() { return _Scene; }
|
||||
|
||||
/// Get a manager of playlist
|
||||
/// @return pointer to the UPlayListManager
|
||||
inline NL3D::UPlayListManager *getPlayListManager() { return _PlayListManager; }
|
||||
|
||||
void setCamera(NL3D::UScene *scene, NLMISC::CAABBox &bbox, NL3D::UTransform &entity, bool high_z=false);
|
||||
bool setupLight(const NLMISC::CVector &position, const NLMISC::CVector &direction);
|
||||
|
||||
QIcon* saveOneImage(std::string shapename);
|
||||
|
||||
virtual void setVisible(bool visible);
|
||||
|
||||
QWidget* getWidget() {return this;}
|
||||
|
||||
virtual QString name() const {return ("ObjectViewerWidget");}
|
||||
|
||||
protected:
|
||||
#if defined(NL_OS_WINDOWS)
|
||||
virtual bool winEvent(MSG * message, long * result);
|
||||
#elif defined(NL_OS_MAC)
|
||||
virtual bool macEvent(EventHandlerCallRef caller, EventRef event);
|
||||
#elif defined(NL_OS_UNIX)
|
||||
virtual bool x11Event(XEvent *event);
|
||||
#endif
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateRender();
|
||||
|
||||
private:
|
||||
|
||||
/// Update the animation time for Particle System animation.
|
||||
/// @param deltaTime - set the manual animation time.
|
||||
void updateAnimatePS(uint64 deltaTime = 0);
|
||||
|
||||
static CObjectViewerWidget *_objectViewerWidget;
|
||||
|
||||
NLMISC::CLibraryContext *_LibContext;
|
||||
|
||||
// render stuff
|
||||
QTimer *_mainTimer;
|
||||
bool _isGraphicsInitialized, _isGraphicsEnabled;
|
||||
|
||||
void updateInitialization(bool visible);
|
||||
|
||||
void deleteEntity (CEntity &entity);
|
||||
|
||||
/// Delete all entities
|
||||
void deleteEntities();
|
||||
|
||||
NLMISC::CRGBA _BackgroundColor;
|
||||
|
||||
NL3D::UDriver *_Driver;
|
||||
NL3D::UScene *_Scene;
|
||||
NL3D::UPlayListManager *_PlayListManager;
|
||||
NL3D::ULight *_Light;
|
||||
NL3D::UCamera *_Camera;
|
||||
NL3D::U3dMouseListener *_MouseListener;
|
||||
|
||||
// The entities storage
|
||||
CEntities _Entities;
|
||||
|
||||
/// Camera parameters.
|
||||
float _phi, _psi, _dist;
|
||||
float _CameraFocal;
|
||||
|
||||
bool _Direct3D;
|
||||
bool _BloomEffect;
|
||||
|
||||
std::string _CurrentInstance;
|
||||
|
||||
// a temporary solution, and later remove
|
||||
friend class CAnimationSetDialog;
|
||||
|
||||
};/* class CObjectViewerWidget */
|
||||
|
||||
} /* namespace NLQT */
|
||||
|
||||
#endif // OBJECT_VIEWER_WIDGET_H
|
||||
void updateAnimatePS(uint64 deltaTime = 0);
|
||||
|
||||
static CObjectViewerWidget *_objectViewerWidget;
|
||||
|
||||
NLMISC::CLibraryContext *_LibContext;
|
||||
|
||||
// render stuff
|
||||
QTimer *_mainTimer;
|
||||
bool _isGraphicsInitialized, _isGraphicsEnabled;
|
||||
|
||||
void updateInitialization(bool visible);
|
||||
|
||||
void deleteEntity (CEntity &entity);
|
||||
|
||||
/// Delete all entities
|
||||
void deleteEntities();
|
||||
|
||||
NLMISC::CRGBA _BackgroundColor;
|
||||
|
||||
NL3D::UDriver *_Driver;
|
||||
NL3D::UScene *_Scene;
|
||||
NL3D::UPlayListManager *_PlayListManager;
|
||||
NL3D::ULight *_Light;
|
||||
NL3D::UCamera *_Camera;
|
||||
NL3D::U3dMouseListener *_MouseListener;
|
||||
|
||||
// The entities storage
|
||||
CEntities _Entities;
|
||||
|
||||
/// Camera parameters.
|
||||
float _phi, _psi, _dist;
|
||||
float _CameraFocal;
|
||||
|
||||
bool _Direct3D;
|
||||
bool _BloomEffect;
|
||||
|
||||
std::string _CurrentInstance;
|
||||
|
||||
// a temporary solution, and later remove
|
||||
friend class CAnimationSetDialog;
|
||||
|
||||
};/* class CObjectViewerWidget */
|
||||
|
||||
} /* namespace NLQT */
|
||||
|
||||
#endif // OBJECT_VIEWER_WIDGET_H
|
||||
|
@ -1,59 +1,59 @@
|
||||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
#ifndef RYAI_SPAWN_COMMANDS_H
|
||||
#define RYAI_SPAWN_COMMANDS_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/debug.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
//class CAISpawnCtrl
|
||||
//{
|
||||
//public:
|
||||
// static bool spawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawn(aiInstance, name); }
|
||||
// static bool spawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMap(aiInstance, name); }
|
||||
// static bool spawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMgr(aiInstance, name); }
|
||||
// static bool spawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnGrp(aiInstance, name); }
|
||||
// static bool spawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnAll(aiInstance); }
|
||||
//
|
||||
// static bool despawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawn(aiInstance, name); }
|
||||
// static bool despawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMap(aiInstance, name); }
|
||||
// static bool despawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMgr(aiInstance, name); }
|
||||
// static bool despawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnGrp(aiInstance, name); }
|
||||
// static bool despawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnAll(aiInstance); }
|
||||
//
|
||||
//protected:
|
||||
// virtual bool _spawn (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnMap (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnMgr (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnGrp (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnAll (int aiInstance)=0;
|
||||
//
|
||||
// virtual bool _despawn (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnMap (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnMgr (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnGrp (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnAll (int aiInstance)=0;
|
||||
//
|
||||
// static CAISpawnCtrl *_instance;
|
||||
//};
|
||||
|
||||
#endif
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/debug.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
//class CAISpawnCtrl
|
||||
//{
|
||||
//public:
|
||||
// static bool spawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawn(aiInstance, name); }
|
||||
// static bool spawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMap(aiInstance, name); }
|
||||
// static bool spawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMgr(aiInstance, name); }
|
||||
// static bool spawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnGrp(aiInstance, name); }
|
||||
// static bool spawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnAll(aiInstance); }
|
||||
//
|
||||
// static bool despawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawn(aiInstance, name); }
|
||||
// static bool despawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMap(aiInstance, name); }
|
||||
// static bool despawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMgr(aiInstance, name); }
|
||||
// static bool despawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnGrp(aiInstance, name); }
|
||||
// static bool despawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnAll(aiInstance); }
|
||||
//
|
||||
//protected:
|
||||
// virtual bool _spawn (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnMap (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnMgr (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnGrp (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _spawnAll (int aiInstance)=0;
|
||||
//
|
||||
// virtual bool _despawn (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnMap (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnMgr (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnGrp (int aiInstance, const std::string &name)=0;
|
||||
// virtual bool _despawnAll (int aiInstance)=0;
|
||||
//
|
||||
// static CAISpawnCtrl *_instance;
|
||||
//};
|
||||
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue