Merge branch 'master' into npc-additional-data

Conflicts:
	apps/opencs/view/world/dialoguesubview.cpp
c++11
cc9cii 10 years ago
commit c721e340d8

@ -98,6 +98,7 @@ Programmers
Sebastian Wick (swick) Sebastian Wick (swick)
Sergey Shambir Sergey Shambir
sir_herrbatka sir_herrbatka
smbas
Stefan Galowicz (bogglez) Stefan Galowicz (bogglez)
Stanislav Bobrov (Jiub) Stanislav Bobrov (Jiub)
Sylvain Thesnieres (Garvek) Sylvain Thesnieres (Garvek)
@ -109,6 +110,13 @@ Programmers
Vincent Heuken Vincent Heuken
vocollapse vocollapse
Manual
------
Bodillium
Cramal
sir_herrbatka
Packagers Packagers
--------- ---------

@ -28,6 +28,7 @@
Bug #2521: NPCs don't react to stealing when inventory menu is open. Bug #2521: NPCs don't react to stealing when inventory menu is open.
Bug #2525: Can't click on red dialogue choice [rise of house telvanni][60fffec] Bug #2525: Can't click on red dialogue choice [rise of house telvanni][60fffec]
Bug #2530: GetSpellEffects not working as in vanilla Bug #2530: GetSpellEffects not working as in vanilla
Bug #2557: Crash on first launch after choosing "Run installation wizard"
Feature #139: Editor: Global Search & Replace Feature #139: Editor: Global Search & Replace
Feature #1219: Editor: Add dialogue mode only columns Feature #1219: Editor: Add dialogue mode only columns
Feature #2024: Hotkey for hand to hand (i.e. unequip any weapon) Feature #2024: Hotkey for hand to hand (i.e. unequip any weapon)

@ -351,7 +351,7 @@ endif()
# CXX Compiler settings # CXX Compiler settings
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-reorder -std=c++98 -pedantic -Wno-long-long") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -std=c++98 -pedantic -Wno-long-long")
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE)
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE CLANG_VERSION) execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE CLANG_VERSION)

@ -36,13 +36,13 @@ QString getAspect(int x, int y)
} }
Launcher::GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, GraphicsSettings &graphicsSetting, QWidget *parent) Launcher::GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, GraphicsSettings &graphicsSetting, QWidget *parent)
: mOgre(NULL) : QWidget(parent)
, mOgre(NULL)
, mSelectedRenderSystem(NULL) , mSelectedRenderSystem(NULL)
, mOpenGLRenderSystem(NULL) , mOpenGLRenderSystem(NULL)
, mDirect3DRenderSystem(NULL) , mDirect3DRenderSystem(NULL)
, mCfgMgr(cfg) , mCfgMgr(cfg)
, mGraphicsSettings(graphicsSetting) , mGraphicsSettings(graphicsSetting)
, QWidget(parent)
{ {
setObjectName ("GraphicsPage"); setObjectName ("GraphicsPage");
setupUi(this); setupUi(this);

@ -59,14 +59,16 @@ int main(int argc, char *argv[])
Launcher::MainDialog mainWin; Launcher::MainDialog mainWin;
if (!mainWin.showFirstRunDialog()) Launcher::FirstRunDialogResult result = mainWin.showFirstRunDialog();
if (result == Launcher::FirstRunDialogResultFailure)
return 0; return 0;
// if (!mainWin.setup()) { // if (!mainWin.setup()) {
// return 0; // return 0;
// } // }
mainWin.show(); if (result == Launcher::FirstRunDialogResultContinue)
mainWin.show();
int returnValue = app.exec(); int returnValue = app.exec();
SDL_Quit(); SDL_Quit();

@ -148,10 +148,10 @@ void Launcher::MainDialog::createPages()
} }
bool Launcher::MainDialog::showFirstRunDialog() Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog()
{ {
if (!setupLauncherSettings()) if (!setupLauncherSettings())
return false; return FirstRunDialogResultFailure;
if (mLauncherSettings.value(QString("General/firstrun"), QString("true")) == QLatin1String("true")) if (mLauncherSettings.value(QString("General/firstrun"), QString("true")) == QLatin1String("true"))
{ {
@ -176,14 +176,14 @@ bool Launcher::MainDialog::showFirstRunDialog()
if (msgBox.clickedButton() == wizardButton) if (msgBox.clickedButton() == wizardButton)
{ {
if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) { if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) {
return false; return FirstRunDialogResultFailure;
} else { } else {
return true; return FirstRunDialogResultWizard;
} }
} }
} }
return setup(); return setup() ? FirstRunDialogResultContinue : FirstRunDialogResultFailure;
} }
bool Launcher::MainDialog::setup() bool Launcher::MainDialog::setup()

@ -31,6 +31,13 @@ namespace Launcher
class UnshieldThread; class UnshieldThread;
class SettingsPage; class SettingsPage;
enum FirstRunDialogResult
{
FirstRunDialogResultFailure,
FirstRunDialogResultContinue,
FirstRunDialogResultWizard
};
#ifndef WIN32 #ifndef WIN32
bool expansions(Launcher::UnshieldThread& cd); bool expansions(Launcher::UnshieldThread& cd);
#endif #endif
@ -44,7 +51,7 @@ namespace Launcher
~MainDialog(); ~MainDialog();
bool setup(); bool setup();
bool showFirstRunDialog(); FirstRunDialogResult showFirstRunDialog();
bool reloadSettings(); bool reloadSettings();
bool writeSettings(); bool writeSettings();

@ -18,10 +18,10 @@ using namespace Process;
Launcher::SettingsPage::SettingsPage(Files::ConfigurationManager &cfg, Launcher::SettingsPage::SettingsPage(Files::ConfigurationManager &cfg,
Config::GameSettings &gameSettings, Config::GameSettings &gameSettings,
Config::LauncherSettings &launcherSettings, MainDialog *parent) Config::LauncherSettings &launcherSettings, MainDialog *parent)
: mCfgMgr(cfg) : QWidget(parent)
, mCfgMgr(cfg)
, mGameSettings(gameSettings) , mGameSettings(gameSettings)
, mLauncherSettings(launcherSettings) , mLauncherSettings(launcherSettings)
, QWidget(parent)
, mMain(parent) , mMain(parent)
{ {
setupUi(this); setupUi(this);

@ -46,7 +46,7 @@ opencs_units_noqt (model/tools
opencs_units (view/doc opencs_units (view/doc
viewmanager view operations operation subview startup filedialog newgame viewmanager view operations operation subview startup filedialog newgame
filewidget adjusterwidget loader globaldebugprofilemenu runlogsubview filewidget adjusterwidget loader globaldebugprofilemenu runlogsubview sizehint
) )

@ -23,8 +23,8 @@
CS::Editor::Editor (OgreInit::OgreInit& ogreInit) CS::Editor::Editor (OgreInit::OgreInit& ogreInit)
: mUserSettings (mCfgMgr), mOverlaySystem (0), mDocumentManager (mCfgMgr), : mUserSettings (mCfgMgr), mOverlaySystem (0), mDocumentManager (mCfgMgr),
mViewManager (mDocumentManager), mViewManager (mDocumentManager), mPid(""),
mIpcServerName ("org.openmw.OpenCS"), mServer(NULL), mClientSocket(NULL), mPid(""), mLock() mLock(), mIpcServerName ("org.openmw.OpenCS"), mServer(NULL), mClientSocket(NULL)
{ {
std::pair<Files::PathContainer, std::vector<std::string> > config = readConfig(); std::pair<Files::PathContainer, std::vector<std::string> > config = readConfig();

@ -2251,11 +2251,12 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration,
ToUTF8::FromType encoding, const CSMWorld::ResourcesManager& resourcesManager, ToUTF8::FromType encoding, const CSMWorld::ResourcesManager& resourcesManager,
const std::vector<std::string>& blacklistedScripts) const std::vector<std::string>& blacklistedScripts)
: mSavePath (savePath), mContentFiles (files), mNew (new_), mData (encoding, resourcesManager), : mSavePath (savePath), mContentFiles (files), mNew (new_), mData (encoding, resourcesManager),
mTools (*this), mResDir(resDir), mTools (*this),
mProjectPath ((configuration.getUserDataPath() / "projects") / mProjectPath ((configuration.getUserDataPath() / "projects") /
(savePath.filename().string() + ".project")), (savePath.filename().string() + ".project")),
mSavingOperation (*this, mProjectPath, encoding), mSavingOperation (*this, mProjectPath, encoding),
mSaving (&mSavingOperation), mSaving (&mSavingOperation),
mResDir(resDir),
mRunner (mProjectPath), mPhysics(boost::shared_ptr<CSVWorld::PhysicsSystem>()) mRunner (mProjectPath), mPhysics(boost::shared_ptr<CSVWorld::PhysicsSystem>())
{ {
if (mContentFiles.empty()) if (mContentFiles.empty())

@ -9,7 +9,7 @@
CSMFilter::ValueNode::ValueNode (int columnId, Type lowerType, Type upperType, CSMFilter::ValueNode::ValueNode (int columnId, Type lowerType, Type upperType,
double lower, double upper) double lower, double upper)
: mColumnId (columnId), mLowerType (lowerType), mUpperType (upperType), mLower (lower), mUpper (upper){} : mColumnId (columnId), mLower (lower), mUpper (upper), mLowerType (lowerType), mUpperType (upperType){}
bool CSMFilter::ValueNode::test (const CSMWorld::IdTableBase& table, int row, bool CSMFilter::ValueNode::test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const const std::map<int, int>& columns) const

@ -4,7 +4,7 @@
CSMSettings::Connector::Connector(CSVSettings::View *master, CSMSettings::Connector::Connector(CSVSettings::View *master,
QObject *parent) QObject *parent)
: mMasterView (master), QObject(parent) : QObject(parent), mMasterView (master)
{} {}
void CSMSettings::Connector::addSlaveView (CSVSettings::View *view, void CSMSettings::Connector::addSlaveView (CSVSettings::View *view,

@ -143,6 +143,24 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
minWidth->setDefaultValue (325); minWidth->setDefaultValue (325);
minWidth->setRange (50, 10000); minWidth->setRange (50, 10000);
minWidth->setToolTip ("Minimum width of subviews."); minWidth->setToolTip ("Minimum width of subviews.");
QString defaultScroll = "Scrollbar Only";
QStringList scrollValues = QStringList() << defaultScroll << "Grow Only" << "Grow then Scroll";
Setting *mainwinScroll = createSetting (Type_RadioButton, "mainwindow-scrollbar",
"Add a horizontal scrollbar to the main view window.");
mainwinScroll->setDefaultValue (defaultScroll);
mainwinScroll->setDeclaredValues (scrollValues);
mainwinScroll->setToolTip ("Scrollbar Only: Simple addition of scrollbars, the view window does not grow"
" automatically.\n"
"Grow Only: Original Editor behaviour. The view window grows as subviews are added. No scrollbars.\n"
"Grow then Scroll: The view window grows. The scrollbar appears once it cannot grow any further.");
Setting *grow = createSetting (Type_CheckBox, "grow-limit", "Grow Limit Screen");
grow->setDefaultValue ("false");
grow->setToolTip ("When \"Grow then Scroll\" option is selected, the window size grows to"
" the width of the virtual desktop. \nIf this option is selected the the window growth"
"is limited to the current screen.");
} }
declareSection ("records", "Records"); declareSection ("records", "Records");

@ -11,8 +11,8 @@ CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(
const CSMWorld::IdCollection<ESM::Faction>& faction) const CSMWorld::IdCollection<ESM::Faction>& faction)
: :
mReferencables(referenceable), mReferencables(referenceable),
mClasses(classes),
mRaces(races), mRaces(races),
mClasses(classes),
mFactions(faction), mFactions(faction),
mPlayerPresent(false) mPlayerPresent(false)
{ {

@ -103,8 +103,8 @@ CSMDoc::OperationHolder *CSMTools::Tools::getVerifier()
} }
CSMTools::Tools::Tools (CSMDoc::Document& document) CSMTools::Tools::Tools (CSMDoc::Document& document)
: mDocument (document), mData (document.getData()), mVerifierOperation (0), mNextReportNumber (0), : mDocument (document), mData (document.getData()), mVerifierOperation (0),
mSearchOperation (0) mSearchOperation (0), mNextReportNumber (0)
{ {
// index 0: load error log // index 0: load error log
mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel)); mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel));

@ -3,7 +3,7 @@
#include "columns.hpp" #include "columns.hpp"
CSMWorld::ColumnBase::ColumnBase (int columnId, Display displayType, int flags) CSMWorld::ColumnBase::ColumnBase (int columnId, Display displayType, int flags)
: mColumnId (columnId), mDisplayType (displayType), mFlags (flags) : mColumnId (columnId), mFlags (flags), mDisplayType (displayType)
{} {}
CSMWorld::ColumnBase::~ColumnBase() {} CSMWorld::ColumnBase::~ColumnBase() {}

@ -83,7 +83,7 @@ std::vector<std::string> CSMWorld::CommandDispatcher::getRevertableRecords() con
CSMWorld::CommandDispatcher::CommandDispatcher (CSMDoc::Document& document, CSMWorld::CommandDispatcher::CommandDispatcher (CSMDoc::Document& document,
const CSMWorld::UniversalId& id, QObject *parent) const CSMWorld::UniversalId& id, QObject *parent)
: QObject (parent), mDocument (document), mId (id), mLocked (false) : QObject (parent), mLocked (false), mDocument (document), mId (id)
{} {}
void CSMWorld::CommandDispatcher::setEditLock (bool locked) void CSMWorld::CommandDispatcher::setEditLock (bool locked)

@ -235,12 +235,12 @@ CSMWorld::DeleteNestedCommand::DeleteNestedCommand (IdTree& model,
int nestedRow, int nestedRow,
int parentColumn, int parentColumn,
QUndoCommand* parent) : QUndoCommand* parent) :
mId(id), QUndoCommand(parent),
NestedTableStoring(model, id, parentColumn),
mModel(model), mModel(model),
mId(id),
mParentColumn(parentColumn), mParentColumn(parentColumn),
QUndoCommand(parent), mNestedRow(nestedRow)
mNestedRow(nestedRow),
NestedTableStoring(model, id, parentColumn)
{ {
std::string title = std::string title =
model.headerData(parentColumn, Qt::Horizontal, Qt::DisplayRole).toString().toUtf8().constData(); model.headerData(parentColumn, Qt::Horizontal, Qt::DisplayRole).toString().toUtf8().constData();
@ -263,12 +263,12 @@ void CSMWorld::DeleteNestedCommand::undo()
} }
CSMWorld::AddNestedCommand::AddNestedCommand(IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent) CSMWorld::AddNestedCommand::AddNestedCommand(IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent)
: mModel(model), : QUndoCommand(parent),
NestedTableStoring(model, id, parentColumn),
mModel(model),
mId(id), mId(id),
mNewRow(nestedRow), mNewRow(nestedRow),
mParentColumn(parentColumn), mParentColumn(parentColumn)
QUndoCommand(parent),
NestedTableStoring(model, id, parentColumn)
{ {
std::string title = std::string title =
model.headerData(parentColumn, Qt::Horizontal, Qt::DisplayRole).toString().toUtf8().constData(); model.headerData(parentColumn, Qt::Horizontal, Qt::DisplayRole).toString().toUtf8().constData();

@ -13,7 +13,7 @@ CSMWorld::PotionColumns::PotionColumns (const InventoryColumns& columns)
CSMWorld::PotionRefIdAdapter::PotionRefIdAdapter (const PotionColumns& columns, CSMWorld::PotionRefIdAdapter::PotionRefIdAdapter (const PotionColumns& columns,
const RefIdColumn *autoCalc) const RefIdColumn *autoCalc)
: InventoryRefIdAdapter<ESM::Potion> (UniversalId::Type_Potion, columns), : InventoryRefIdAdapter<ESM::Potion> (UniversalId::Type_Potion, columns),
mAutoCalc (autoCalc), mColumns(columns) mColumns(columns), mAutoCalc (autoCalc)
{} {}
QVariant CSMWorld::PotionRefIdAdapter::getData (const RefIdColumn *column, const RefIdData& data, QVariant CSMWorld::PotionRefIdAdapter::getData (const RefIdColumn *column, const RefIdData& data,

@ -176,7 +176,6 @@ void CSMWorld::RefIdData::erase (const LocalIndex& index, int count)
{ {
std::map<UniversalId::Type, RefIdDataContainerBase *>::iterator iter = std::map<UniversalId::Type, RefIdDataContainerBase *>::iterator iter =
mRecordContainers.find (index.second); mRecordContainers.find (index.second);
if (iter==mRecordContainers.end()) if (iter==mRecordContainers.end())
throw std::logic_error ("invalid local index type"); throw std::logic_error ("invalid local index type");
@ -189,6 +188,20 @@ void CSMWorld::RefIdData::erase (const LocalIndex& index, int count)
mIndex.erase (result); mIndex.erase (result);
} }
// Adjust the local indexes to avoid gaps between them after removal of records
int recordIndex = index.first + count;
int recordCount = iter->second->getSize();
while (recordIndex < recordCount)
{
std::map<std::string, LocalIndex>::iterator recordIndexFound =
mIndex.find(Misc::StringUtils::lowerCase(iter->second->getId(recordIndex)));
if (recordIndexFound != mIndex.end())
{
recordIndexFound->second.first -= count;
}
++recordIndex;
}
iter->second->erase (index.first, count); iter->second->erase (index.first, count);
} }

@ -18,7 +18,7 @@
#include "adjusterwidget.hpp" #include "adjusterwidget.hpp"
CSVDoc::FileDialog::FileDialog(QWidget *parent) : CSVDoc::FileDialog::FileDialog(QWidget *parent) :
QDialog(parent), mSelector (0), mFileWidget (0), mAdjusterWidget (0), mDialogBuilt(false), mAction(ContentAction_Undefined) QDialog(parent), mSelector (0), mAction(ContentAction_Undefined), mFileWidget (0), mAdjusterWidget (0), mDialogBuilt(false)
{ {
ui.setupUi (this); ui.setupUi (this);
resize(400, 400); resize(400, 400);

@ -0,0 +1,17 @@
#include "sizehint.hpp"
CSVDoc::SizeHintWidget::SizeHintWidget(QWidget *parent) : QWidget(parent)
{}
CSVDoc::SizeHintWidget::~SizeHintWidget()
{}
QSize CSVDoc::SizeHintWidget::sizeHint() const
{
return mSize;
}
void CSVDoc::SizeHintWidget::setSizeHint(const QSize &size)
{
mSize = size;
}

@ -0,0 +1,22 @@
#ifndef CSV_DOC_SIZEHINT_H
#define CSV_DOC_SIZEHINT_H
#include <QWidget>
#include <QSize>
namespace CSVDoc
{
class SizeHintWidget : public QWidget
{
QSize mSize;
public:
SizeHintWidget(QWidget *parent = 0);
~SizeHintWidget();
virtual QSize sizeHint() const;
void setSizeHint(const QSize &size);
};
}
#endif // CSV_DOC_SIZEHINT_H

@ -9,6 +9,10 @@
#include <QDockWidget> #include <QDockWidget>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QScrollArea>
#include <QHBoxLayout>
#include <QDesktopWidget>
#include <QScrollBar>
#include "../../model/doc/document.hpp" #include "../../model/doc/document.hpp"
#include "../../model/settings/usersettings.hpp" #include "../../model/settings/usersettings.hpp"
@ -16,6 +20,7 @@
#include "../../model/world/idtable.hpp" #include "../../model/world/idtable.hpp"
#include "../world/subviews.hpp" #include "../world/subviews.hpp"
#include "../world/tablesubview.hpp"
#include "../tools/subviews.hpp" #include "../tools/subviews.hpp"
@ -334,8 +339,15 @@ void CSVDoc::View::updateTitle()
void CSVDoc::View::updateSubViewIndicies(SubView *view) void CSVDoc::View::updateSubViewIndicies(SubView *view)
{ {
if(view && mSubViews.contains(view)) if(view && mSubViews.contains(view))
{
mSubViews.removeOne(view); mSubViews.removeOne(view);
// adjust (reduce) the scroll area (even floating), except when it is "Scrollbar Only"
CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance();
if(settings.settingValue ("window/mainwindow-scrollbar") == "Grow then Scroll")
updateScrollbar();
}
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
bool hideTitle = userSettings.setting ("window/hide-subview", QString ("false"))=="true" && bool hideTitle = userSettings.setting ("window/hide-subview", QString ("false"))=="true" &&
@ -381,7 +393,7 @@ void CSVDoc::View::updateActions()
CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews) CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews)
: mViewManager (viewManager), mDocument (document), mViewIndex (totalViews-1), : mViewManager (viewManager), mDocument (document), mViewIndex (totalViews-1),
mViewTotal (totalViews) mViewTotal (totalViews), mScroll(0), mScrollbarOnly(false)
{ {
int width = CSMSettings::UserSettings::instance().settingValue int width = CSMSettings::UserSettings::instance().settingValue
("window/default-width").toInt(); ("window/default-width").toInt();
@ -400,7 +412,18 @@ CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int to
mSubViewWindow.setDockOptions (QMainWindow::AllowNestedDocks); mSubViewWindow.setDockOptions (QMainWindow::AllowNestedDocks);
setCentralWidget (&mSubViewWindow); CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance();
if(settings.settingValue ("window/mainwindow-scrollbar") == "Grow Only")
{
setCentralWidget (&mSubViewWindow);
}
else
{
mScroll = new QScrollArea(this);
mScroll->setWidgetResizable(true);
mScroll->setWidget(&mSubViewWindow);
setCentralWidget(mScroll);
}
mOperations = new Operations; mOperations = new Operations;
addDockWidget (Qt::BottomDockWidgetArea, mOperations); addDockWidget (Qt::BottomDockWidgetArea, mOperations);
@ -527,6 +550,54 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
view->setStatusBar (mShowStatusBar->isChecked()); view->setStatusBar (mShowStatusBar->isChecked());
// Work out how to deal with additional subviews
//
// Policy for "Grow then Scroll":
//
// - Increase the horizontal width of the mainwindow until it becomes greater than or equal
// to the screen (monitor) width.
// - Move the mainwindow position sideways if necessary to fit within the screen.
// - Any more additions increases the size of the mSubViewWindow (horizontal scrollbar
// should become visible)
// - Move the scroll bar to the newly added subview
//
CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance();
QString mainwinScroll = settings.settingValue ("window/mainwindow-scrollbar");
mScrollbarOnly = mainwinScroll.isEmpty() || mainwinScroll == "Scrollbar Only";
QDesktopWidget *dw = QApplication::desktop();
QRect rect;
if(settings.settingValue ("window/grow-limit") == "true")
rect = dw->screenGeometry(this);
else
rect = dw->screenGeometry(dw->screen(dw->screenNumber(this)));
if (!mScrollbarOnly && mScroll && mSubViews.size() > 1)
{
int newWidth = width()+minWidth;
int frameWidth = frameGeometry().width() - width();
if (newWidth+frameWidth <= rect.width())
{
resize(newWidth, height());
// WARNING: below code assumes that new subviews are added to the right
if (x() > rect.width()-(newWidth+frameWidth))
move(rect.width()-(newWidth+frameWidth), y()); // shift left to stay within the screen
}
else
{
// full width
resize(rect.width()-frameWidth, height());
mSubViewWindow.setMinimumWidth(mSubViewWindow.width()+minWidth);
move(0, y());
}
// Make the new subview visible, setFocus() or raise() don't seem to work
// On Ubuntu the scrollbar does not go right to the end, even if using
// mScroll->horizontalScrollBar()->setValue(mScroll->horizontalScrollBar()->maximum());
if (mSubViewWindow.width() > rect.width())
mScroll->horizontalScrollBar()->setValue(mSubViewWindow.width());
}
mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view); mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view);
updateSubViewIndicies(); updateSubViewIndicies();
@ -774,6 +845,48 @@ void CSVDoc::View::updateUserSetting (const QString &name, const QStringList &li
{ {
subView->updateUserSetting (name, list); subView->updateUserSetting (name, list);
} }
if (name=="window/mainwindow-scrollbar")
{
if(list.at(0) != "Grow Only")
{
if (mScroll)
{
if (list.at(0).isEmpty() || list.at(0) == "Scrollbar Only")
{
mScrollbarOnly = true;
mSubViewWindow.setMinimumWidth(0);
}
else
{
if(!mScrollbarOnly)
return;
mScrollbarOnly = false;
updateScrollbar();
}
}
else
{
mScroll = new QScrollArea(this);
mScroll->setWidgetResizable(true);
mScroll->setWidget(&mSubViewWindow);
setCentralWidget(mScroll);
}
}
else
{
if (mScroll)
{
mScroll->takeWidget();
setCentralWidget (&mSubViewWindow);
mScroll->deleteLater();
mScroll = 0;
}
else
return;
}
}
} }
void CSVDoc::View::toggleShowStatusBar (bool show) void CSVDoc::View::toggleShowStatusBar (bool show)
@ -818,3 +931,26 @@ void CSVDoc::View::closeRequest (SubView *subView)
else if (mViewManager.closeRequest (this)) else if (mViewManager.closeRequest (this))
mViewManager.removeDocAndView (mDocument); mViewManager.removeDocAndView (mDocument);
} }
void CSVDoc::View::updateScrollbar()
{
QRect rect;
QWidget *topLevel = QApplication::topLevelAt(pos());
if (topLevel)
rect = topLevel->rect();
else
rect = this->rect();
int newWidth = 0;
for (int i = 0; i < mSubViews.size(); ++i)
{
newWidth += mSubViews[i]->width();
}
int frameWidth = frameGeometry().width() - width();
if ((newWidth+frameWidth) >= rect.width())
mSubViewWindow.setMinimumWidth(newWidth);
else
mSubViewWindow.setMinimumWidth(0);
}

@ -10,6 +10,7 @@
class QAction; class QAction;
class QDockWidget; class QDockWidget;
class QScrollArea;
namespace CSMDoc namespace CSMDoc
{ {
@ -47,6 +48,8 @@ namespace CSVDoc
SubViewFactoryManager mSubViewFactory; SubViewFactoryManager mSubViewFactory;
QMainWindow mSubViewWindow; QMainWindow mSubViewWindow;
GlobalDebugProfileMenu *mGlobalDebugProfileMenu; GlobalDebugProfileMenu *mGlobalDebugProfileMenu;
QScrollArea *mScroll;
bool mScrollbarOnly;
// not implemented // not implemented
@ -87,6 +90,8 @@ namespace CSVDoc
/// User preference function /// User preference function
void resizeViewHeight (int height); void resizeViewHeight (int height);
void updateScrollbar();
public: public:
View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews); View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews);

@ -55,7 +55,7 @@ bool CSVRender::Cell::addObjects (int start, int end)
CSVRender::Cell::Cell (CSMWorld::Data& data, Ogre::SceneManager *sceneManager, CSVRender::Cell::Cell (CSMWorld::Data& data, Ogre::SceneManager *sceneManager,
const std::string& id, boost::shared_ptr<CSVWorld::PhysicsSystem> physics, const Ogre::Vector3& origin) const std::string& id, boost::shared_ptr<CSVWorld::PhysicsSystem> physics, const Ogre::Vector3& origin)
: mData (data), mId (Misc::StringUtils::lowerCase (id)), mSceneMgr(sceneManager), mPhysics(physics), mX(0), mY(0) : mData (data), mId (Misc::StringUtils::lowerCase (id)), mPhysics(physics), mSceneMgr(sceneManager), mX(0), mY(0)
{ {
mCellNode = sceneManager->getRootSceneNode()->createChildSceneNode(); mCellNode = sceneManager->getRootSceneNode()->createChildSceneNode();
mCellNode->setPosition (origin); mCellNode->setPosition (origin);

@ -56,11 +56,11 @@ namespace CSVRender
// //
MouseState::MouseState(WorldspaceWidget *parent) MouseState::MouseState(WorldspaceWidget *parent)
: mParent(parent), mPhysics(parent->mDocument.getPhysics()), mSceneManager(parent->getSceneManager()) : mMouseState(Mouse_Default), mParent(parent), mPhysics(parent->mDocument.getPhysics())
, mCurrentObj(""), mMouseState(Mouse_Default), mOldPos(0,0), mMouseEventTimer(0), mPlane(0) , mSceneManager(parent->getSceneManager()), mOldPos(0,0), mCurrentObj(""), mGrabbedSceneNode("")
, mGrabbedSceneNode(""), mOrigObjPos(Ogre::Vector3()), mOrigMousePos(Ogre::Vector3()) , mMouseEventTimer(0), mPlane(0), mOrigObjPos(Ogre::Vector3()), mOrigMousePos(Ogre::Vector3())
, mCurrentMousePos(Ogre::Vector3()), mOffset(0.0f) , mCurrentMousePos(Ogre::Vector3()), mOffset(0.0f), mIdTableModel(0), mColIndexPosX(0)
, mColIndexPosX(0), mColIndexPosY(0), mColIndexPosZ(0), mIdTableModel(0) , mColIndexPosY(0), mColIndexPosZ(0)
{ {
const CSMWorld::RefCollection& references = mParent->mDocument.getData().getReferences(); const CSMWorld::RefCollection& references = mParent->mDocument.getData().getReferences();

@ -27,8 +27,8 @@ namespace CSVRender
// http://www.ogre3d.org/tikiwiki/Creating+dynamic+textures // http://www.ogre3d.org/tikiwiki/Creating+dynamic+textures
// http://www.ogre3d.org/tikiwiki/ManualObject // http://www.ogre3d.org/tikiwiki/ManualObject
TextOverlay::TextOverlay(const Ogre::MovableObject* obj, const Ogre::Camera* camera, const Ogre::String& id) TextOverlay::TextOverlay(const Ogre::MovableObject* obj, const Ogre::Camera* camera, const Ogre::String& id)
: mOverlay(0), mCaption(""), mDesc(""), mEnabled(true), mCamera(camera), mObj(obj), mId(id) : mOverlay(0), mCaption(""), mDesc(""), mObj(obj), mCamera(camera), mFontHeight(16), mId(id)
, mOnScreen(false) , mInstance(0), mFontHeight(16) // FIXME: make font height configurable , mEnabled(true), mOnScreen(false), mInstance(0) // FIXME: make font height configurable
{ {
if(id == "" || !camera || !obj) if(id == "" || !camera || !obj)
throw std::runtime_error("TextOverlay could not be created."); throw std::runtime_error("TextOverlay could not be created.");

@ -22,7 +22,7 @@
#include "editmode.hpp" #include "editmode.hpp"
CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent) CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
: SceneWidget (parent), mDocument(document), mSceneElements(0), mRun(0), mPhysics(boost::shared_ptr<CSVWorld::PhysicsSystem>()), mMouse(0), : SceneWidget (parent), mSceneElements(0), mRun(0), mDocument(document), mPhysics(boost::shared_ptr<CSVWorld::PhysicsSystem>()), mMouse(0),
mInteractionMask (0) mInteractionMask (0)
{ {
setAcceptDrops(true); setAcceptDrops(true);

@ -12,7 +12,7 @@
CSVSettings::BooleanView::BooleanView (CSMSettings::Setting *setting, CSVSettings::BooleanView::BooleanView (CSMSettings::Setting *setting,
Page *parent) Page *parent)
: mType(setting->type()), View (setting, parent) : View (setting, parent), mType(setting->type())
{ {
foreach (const QString &value, setting->declaredValues()) foreach (const QString &value, setting->declaredValues())
{ {

@ -23,7 +23,7 @@
#include <QStandardItem> #include <QStandardItem>
CSVSettings::Dialog::Dialog(QMainWindow *parent) CSVSettings::Dialog::Dialog(QMainWindow *parent)
: mStackedWidget (0), mDebugMode (false), SettingWindow (parent) : SettingWindow (parent), mStackedWidget (0), mDebugMode (false)
{ {
setWindowTitle(QString::fromUtf8 ("User Settings")); setWindowTitle(QString::fromUtf8 ("User Settings"));

@ -7,8 +7,8 @@ const QString CSVSettings::Frame::sInvisibleBoxStyle =
CSVSettings::Frame::Frame (bool isVisible, const QString &title, CSVSettings::Frame::Frame (bool isVisible, const QString &title,
QWidget *parent) QWidget *parent)
: mIsHorizontal (true), mLayout (new SettingLayout()), : QGroupBox (title, parent), mIsHorizontal (true),
QGroupBox (title, parent) mLayout (new SettingLayout())
{ {
setFlat (true); setFlat (true);
mVisibleBoxStyle = styleSheet(); mVisibleBoxStyle = styleSheet();

@ -7,7 +7,7 @@
CSVSettings::ListView::ListView(CSMSettings::Setting *setting, CSVSettings::ListView::ListView(CSMSettings::Setting *setting,
Page *parent) Page *parent)
: mComboBox (0), mAbstractItemView (0), View(setting, parent) : View(setting, parent), mAbstractItemView (0), mComboBox (0)
{ {
QWidget *widget = QWidget *widget =
buildWidget(setting->isMultiLine(), setting->widgetWidth()); buildWidget(setting->isMultiLine(), setting->widgetWidth());

@ -19,7 +19,7 @@ QMap <CSVSettings::ViewType, CSVSettings::IViewFactory *>
CSVSettings::Page::Page (const QString &pageName, QList <CSMSettings::Setting *> settingList, CSVSettings::Page::Page (const QString &pageName, QList <CSMSettings::Setting *> settingList,
SettingWindow *parent, const QString& label) SettingWindow *parent, const QString& label)
: mParent(parent), mIsEditorPage (false), Frame(false, "", parent), mLabel (label) : Frame(false, "", parent), mParent(parent), mIsEditorPage (false), mLabel (label)
{ {
setObjectName (pageName); setObjectName (pageName);

@ -3,7 +3,7 @@
#include <QLineEdit> #include <QLineEdit>
CSVSettings::SpinBox::SpinBox(QWidget *parent) CSVSettings::SpinBox::SpinBox(QWidget *parent)
: mValueList(QStringList()), QSpinBox(parent) : QSpinBox(parent), mValueList(QStringList())
{ {
setRange (0, 0); setRange (0, 0);
} }

@ -12,12 +12,12 @@
CSVSettings::View::View(CSMSettings::Setting *setting, CSVSettings::View::View(CSMSettings::Setting *setting,
Page *parent) Page *parent)
: mDataModel(0), mParentPage (parent), : Frame(true, setting->getLabel(), parent),
mParentPage (parent), mDataModel(0),
mHasFixedValues (!setting->declaredValues().isEmpty()), mHasFixedValues (!setting->declaredValues().isEmpty()),
mIsMultiValue (setting->isMultiValue()), mIsMultiValue (setting->isMultiValue()),
mViewKey (setting->page() + '/' + setting->name()), mViewKey (setting->page() + '/' + setting->name()),
mSerializable (setting->serializable()), mSerializable (setting->serializable())
Frame(true, setting->getLabel(), parent)
{ {
if (!setting->getToolTip().isEmpty()) if (!setting->getToolTip().isEmpty())
setToolTip (setting->getToolTip()); setToolTip (setting->getToolTip());

@ -360,15 +360,15 @@ CSVWorld::EditWidget::~EditWidget()
CSVWorld::EditWidget::EditWidget(QWidget *parent, CSVWorld::EditWidget::EditWidget(QWidget *parent,
int row, CSMWorld::IdTable* table, CSMWorld::CommandDispatcher& commandDispatcher, int row, CSMWorld::IdTable* table, CSMWorld::CommandDispatcher& commandDispatcher,
CSMDoc::Document& document, bool createAndDelete) : CSMDoc::Document& document, bool createAndDelete) :
mDispatcher(0),
mNestedTableDispatcher(NULL),
QScrollArea(parent), QScrollArea(parent),
mWidgetMapper(NULL), mWidgetMapper(NULL),
mNestedTableMapper(NULL), mNestedTableMapper(NULL),
mDispatcher(NULL),
mNestedTableDispatcher(NULL),
mMainWidget(NULL), mMainWidget(NULL),
mTable(table),
mCommandDispatcher (commandDispatcher), mCommandDispatcher (commandDispatcher),
mDocument (document), mDocument (document)
mTable(table)
{ {
remake (row); remake (row);
@ -596,8 +596,8 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSM
SubView (id), SubView (id),
mEditWidget(0), mEditWidget(0),
mMainLayout(NULL), mMainLayout(NULL),
mUndoStack(document.getUndoStack()),
mTable(dynamic_cast<CSMWorld::IdTable*>(document.getData().getTableModel(id))), mTable(dynamic_cast<CSMWorld::IdTable*>(document.getData().getTableModel(id))),
mUndoStack(document.getUndoStack()),
mLocked(false), mLocked(false),
mDocument(document), mDocument(document),
mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType())) mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType()))

@ -17,8 +17,8 @@ void CSVWorld::DragRecordTable::startDragFromTable (const CSVWorld::DragRecordTa
} }
CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) : CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) :
mDocument(document),
QTableView(parent), QTableView(parent),
mDocument(document),
mEditLock(false) mEditLock(false)
{} {}

@ -129,9 +129,9 @@ void CSVWorld::GenericCreator::addScope (const QString& name, CSMWorld::Scope sc
CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undoStack, CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undoStack,
const CSMWorld::UniversalId& id, bool relaxedIdRules) const CSMWorld::UniversalId& id, bool relaxedIdRules)
: mData (data), mUndoStack (undoStack), mListId (id), mLocked (false), mCloneMode (false), : mData (data), mUndoStack (undoStack), mListId (id), mLocked (false),
mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (0), mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (0),
mScopeLabel (0) mScopeLabel (0), mCloneMode (false)
{ {
mLayout = new QHBoxLayout; mLayout = new QHBoxLayout;
mLayout->setContentsMargins (0, 0, 0, 0); mLayout->setContentsMargins (0, 0, 0, 0);

@ -27,7 +27,7 @@
#include "creator.hpp" #include "creator.hpp"
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: SubView (id), mLayout(new QHBoxLayout), mDocument(document), mScene(NULL), mToolbar(NULL) : SubView (id), mScene(NULL), mLayout(new QHBoxLayout), mDocument(document), mToolbar(NULL)
{ {
QVBoxLayout *layout = new QVBoxLayout; QVBoxLayout *layout = new QVBoxLayout;

@ -42,13 +42,14 @@ bool CSVWorld::ScriptEdit::event (QEvent *event)
CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode, CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode,
QWidget* parent) QWidget* parent)
: QPlainTextEdit (parent), : QPlainTextEdit (parent),
mDocument (document),
mWhiteListQoutes("^[a-z|_]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive),
mChangeLocked (0), mChangeLocked (0),
mLineNumberArea(0),
mShowLineNum(false), mShowLineNum(false),
mLineNumberArea(0),
mDefaultFont(font()), mDefaultFont(font()),
mMonoFont(QFont("Monospace")) mMonoFont(QFont("Monospace")),
mDocument (document),
mWhiteListQoutes("^[a-z|_]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive)
{ {
// setAcceptRichText (false); // setAcceptRichText (false);
setLineWrapMode (QPlainTextEdit::NoWrap); setLineWrapMode (QPlainTextEdit::NoWrap);

@ -253,8 +253,8 @@ void CSVWorld::Table::mouseDoubleClickEvent (QMouseEvent *event)
CSVWorld::Table::Table (const CSMWorld::UniversalId& id, CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
bool createAndDelete, bool sorting, CSMDoc::Document& document) bool createAndDelete, bool sorting, CSMDoc::Document& document)
: mCreateAction (0), mCloneAction(0), mRecordStatusDisplay (0), : DragRecordTable(document), mCreateAction (0),
DragRecordTable(document) mCloneAction(0),mRecordStatusDisplay (0)
{ {
CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance();
QString jumpSetting = settings.settingValue ("table-input/jump-to-added"); QString jumpSetting = settings.settingValue ("table-input/jump-to-added");

@ -3,10 +3,14 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QEvent> #include <QEvent>
#include <QHeaderView>
#include <QApplication>
#include <QDesktopWidget>
#include "../../model/doc/document.hpp" #include "../../model/doc/document.hpp"
#include "../../model/world/tablemimedata.hpp" #include "../../model/world/tablemimedata.hpp"
#include "../doc/sizehint.hpp"
#include "../filter/filterbox.hpp" #include "../filter/filterbox.hpp"
#include "table.hpp" #include "table.hpp"
#include "tablebottombox.hpp" #include "tablebottombox.hpp"
@ -30,11 +34,18 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
layout->insertWidget (0, mFilterBox); layout->insertWidget (0, mFilterBox);
QWidget *widget = new QWidget; CSVDoc::SizeHintWidget *widget = new CSVDoc::SizeHintWidget;
widget->setLayout (layout); widget->setLayout (layout);
setWidget (widget); setWidget (widget);
// prefer height of the screen and full width of the table
const QRect rect = QApplication::desktop()->screenGeometry(this);
int frameHeight = 40; // set a reasonable default
QWidget *topLevel = QApplication::topLevelAt(pos());
if (topLevel)
frameHeight = topLevel->frameGeometry().height() - topLevel->height();
widget->setSizeHint(QSize(mTable->horizontalHeader()->length(), rect.height()-frameHeight));
connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)), connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)),
this, SLOT (editRequest (const CSMWorld::UniversalId&, const std::string&))); this, SLOT (editRequest (const CSMWorld::UniversalId&, const std::string&)));

@ -17,8 +17,8 @@ MWBase::Environment *MWBase::Environment::sThis = 0;
MWBase::Environment::Environment() MWBase::Environment::Environment()
: mWorld (0), mSoundManager (0), mScriptManager (0), mWindowManager (0), : mWorld (0), mSoundManager (0), mScriptManager (0), mWindowManager (0),
mMechanicsManager (0), mDialogueManager (0), mJournal (0), mInputManager (0), mFrameDuration (0), mMechanicsManager (0), mDialogueManager (0), mJournal (0), mInputManager (0), mStateManager (0),
mStateManager (0) mFrameDuration (0)
{ {
assert (!sThis); assert (!sThis);
sThis = this; sThis = this;

@ -286,8 +286,8 @@ namespace MWBase
virtual MWWorld::Ptr moveObject (const MWWorld::Ptr& ptr, float x, float y, float z) = 0; virtual MWWorld::Ptr moveObject (const MWWorld::Ptr& ptr, float x, float y, float z) = 0;
///< @return an updated Ptr in case the Ptr's cell changes ///< @return an updated Ptr in case the Ptr's cell changes
virtual void virtual MWWorld::Ptr moveObject(const MWWorld::Ptr &ptr, MWWorld::CellStore* newCell, float x, float y, float z) = 0;
moveObject(const MWWorld::Ptr &ptr, MWWorld::CellStore* newCell, float x, float y, float z) = 0; ///< @return an updated Ptr
virtual void scaleObject (const MWWorld::Ptr& ptr, float scale) = 0; virtual void scaleObject (const MWWorld::Ptr& ptr, float scale) = 0;

@ -48,12 +48,15 @@
namespace MWDialogue namespace MWDialogue
{ {
DialogueManager::DialogueManager (const Compiler::Extensions& extensions, bool scriptVerbose, Translation::Storage& translationDataStorage) : DialogueManager::DialogueManager (const Compiler::Extensions& extensions, bool scriptVerbose, Translation::Storage& translationDataStorage) :
mCompilerContext (MWScript::CompilerContext::Type_Dialogue), mTranslationDataStorage(translationDataStorage)
mErrorStream(std::cout.rdbuf()),mErrorHandler(mErrorStream) , mCompilerContext (MWScript::CompilerContext::Type_Dialogue)
, mTemporaryDispositionChange(0.f) , mErrorStream(std::cout.rdbuf())
, mPermanentDispositionChange(0.f), mScriptVerbose (scriptVerbose) , mErrorHandler(mErrorStream)
, mTranslationDataStorage(translationDataStorage)
, mTalkedTo(false) , mTalkedTo(false)
, mTemporaryDispositionChange(0.f)
, mPermanentDispositionChange(0.f)
, mScriptVerbose (scriptVerbose)
{ {
mChoice = -1; mChoice = -1;
mIsInChoice = false; mIsInChoice = false;

@ -26,10 +26,10 @@ namespace MWGui
{ {
AlchemyWindow::AlchemyWindow() AlchemyWindow::AlchemyWindow()
: WindowBase("openmw_alchemy_window.layout") : WindowBase("openmw_alchemy_window.layout")
, mApparatus (4)
, mIngredients (4)
, mSortModel(NULL) , mSortModel(NULL)
, mAlchemy(new MWMechanics::Alchemy()) , mAlchemy(new MWMechanics::Alchemy())
, mApparatus (4)
, mIngredients (4)
{ {
getWidget(mCreateButton, "CreateButton"); getWidget(mCreateButton, "CreateButton");
getWidget(mCancelButton, "CancelButton"); getWidget(mCancelButton, "CancelButton");

@ -228,8 +228,8 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
Typesetter (size_t width, size_t height) : Typesetter (size_t width, size_t height) :
mPageWidth (width), mPageHeight(height), mPageWidth (width), mPageHeight(height),
mSection (NULL), mLine (NULL), mRun (NULL), mSection (NULL), mLine (NULL), mRun (NULL),
mCurrentAlignment (AlignLeft), mCurrentContent (NULL),
mCurrentContent (NULL) mCurrentAlignment (AlignLeft)
{ {
mBook = boost::make_shared <Book> (); mBook = boost::make_shared <Book> ();
} }
@ -697,10 +697,10 @@ namespace
GlyphStream (MyGUI::IFont* font, float left, float top, float Z, GlyphStream (MyGUI::IFont* font, float left, float top, float Z,
MyGUI::Vertex* vertices, RenderXform const & renderXform) : MyGUI::Vertex* vertices, RenderXform const & renderXform) :
mZ(Z), mOrigin (left, top), mZ(Z),
mFont (font), mVertices (vertices), mC(0), mFont (font), mOrigin (left, top),
mRenderXform (renderXform), mVertices (vertices),
mC(0) mRenderXform (renderXform)
{ {
mVertexColourType = MyGUI::RenderManager::getInstance().getVertexFormat(); mVertexColourType = MyGUI::RenderManager::getInstance().getVertexFormat();
} }
@ -801,10 +801,10 @@ protected:
TextFormat (MyGUI::IFont* id, PageDisplay * display) : TextFormat (MyGUI::IFont* id, PageDisplay * display) :
mFont (id), mFont (id),
mCountVertex (0),
mTexture (NULL), mTexture (NULL),
mRenderItem (NULL), mRenderItem (NULL),
mDisplay (display), mDisplay (display)
mCountVertex (0)
{ {
} }

@ -18,9 +18,9 @@ namespace MWGui
BookWindow::BookWindow () BookWindow::BookWindow ()
: WindowBase("openmw_book.layout") : WindowBase("openmw_book.layout")
, mCurrentPage(0)
, mTakeButtonShow(true) , mTakeButtonShow(true)
, mTakeButtonAllowed(true) , mTakeButtonAllowed(true)
, mCurrentPage(0)
{ {
getWidget(mCloseButton, "CloseButton"); getWidget(mCloseButton, "CloseButton");
mCloseButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BookWindow::onCloseButtonClicked); mCloseButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BookWindow::onCloseButtonClicked);

@ -37,11 +37,11 @@ namespace MWGui
CompanionWindow::CompanionWindow(DragAndDrop *dragAndDrop, MessageBoxManager* manager) CompanionWindow::CompanionWindow(DragAndDrop *dragAndDrop, MessageBoxManager* manager)
: WindowBase("openmw_companion_window.layout") : WindowBase("openmw_companion_window.layout")
, mSortModel(NULL)
, mModel(NULL)
, mSelectedItem(-1)
, mDragAndDrop(dragAndDrop) , mDragAndDrop(dragAndDrop)
, mMessageBoxManager(manager) , mMessageBoxManager(manager)
, mSelectedItem(-1)
, mModel(NULL)
, mSortModel(NULL)
{ {
getWidget(mCloseButton, "CloseButton"); getWidget(mCloseButton, "CloseButton");
getWidget(mProfitLabel, "ProfitLabel"); getWidget(mProfitLabel, "ProfitLabel");

@ -33,10 +33,10 @@ namespace MWGui
ContainerWindow::ContainerWindow(DragAndDrop* dragAndDrop) ContainerWindow::ContainerWindow(DragAndDrop* dragAndDrop)
: WindowBase("openmw_container_window.layout") : WindowBase("openmw_container_window.layout")
, mDragAndDrop(dragAndDrop) , mDragAndDrop(dragAndDrop)
, mSelectedItem(-1)
, mModel(NULL)
, mSortModel(NULL)
, mPickpocketDetected(false) , mPickpocketDetected(false)
, mSortModel(NULL)
, mModel(NULL)
, mSelectedItem(-1)
{ {
getWidget(mDisposeCorpseButton, "DisposeCorpseButton"); getWidget(mDisposeCorpseButton, "DisposeCorpseButton");
getWidget(mTakeButton, "TakeButton"); getWidget(mTakeButton, "TakeButton");

@ -248,10 +248,10 @@ namespace MWGui
DialogueWindow::DialogueWindow() DialogueWindow::DialogueWindow()
: WindowBase("openmw_dialogue_window.layout") : WindowBase("openmw_dialogue_window.layout")
, mPersuasionDialog()
, mEnabled(false)
, mServices(0) , mServices(0)
, mEnabled(false)
, mGoodbye(false) , mGoodbye(false)
, mPersuasionDialog()
{ {
// Centre dialog // Centre dialog
center(); center();

@ -20,12 +20,12 @@ namespace MWGui
DragAndDrop::DragAndDrop() DragAndDrop::DragAndDrop()
: mDraggedWidget(NULL) : mIsOnDragAndDrop(false)
, mDraggedCount(0) , mDraggedWidget(NULL)
, mSourceModel(NULL) , mSourceModel(NULL)
, mSourceView(NULL) , mSourceView(NULL)
, mSourceSortModel(NULL) , mSourceSortModel(NULL)
, mIsOnDragAndDrop(false) , mDraggedCount(0)
{ {
} }

@ -50,17 +50,17 @@ namespace MWGui
InventoryWindow::InventoryWindow(DragAndDrop* dragAndDrop) InventoryWindow::InventoryWindow(DragAndDrop* dragAndDrop)
: WindowPinnableBase("openmw_inventory_window.layout") : WindowPinnableBase("openmw_inventory_window.layout")
, mTrading(false) , mDragAndDrop(dragAndDrop)
, mLastXSize(0)
, mLastYSize(0)
, mPreview(new MWRender::InventoryPreview(MWBase::Environment::get().getWorld ()->getPlayerPtr()))
, mPreviewDirty(true) , mPreviewDirty(true)
, mPreviewResize(true) , mPreviewResize(true)
, mDragAndDrop(dragAndDrop) , mSelectedItem(-1)
, mSortModel(NULL) , mSortModel(NULL)
, mTradeModel(NULL) , mTradeModel(NULL)
, mSelectedItem(-1)
, mGuiMode(GM_Inventory) , mGuiMode(GM_Inventory)
, mLastXSize(0)
, mLastYSize(0)
, mPreview(new MWRender::InventoryPreview(MWBase::Environment::get().getWorld ()->getPlayerPtr()))
, mTrading(false)
{ {
mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord += MyGUI::newDelegate(this, &InventoryWindow::onWindowResize); mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord += MyGUI::newDelegate(this, &InventoryWindow::onWindowResize);

@ -14,10 +14,10 @@ namespace MWGui
{ {
ItemStack::ItemStack(const MWWorld::Ptr &base, ItemModel *creator, size_t count) ItemStack::ItemStack(const MWWorld::Ptr &base, ItemModel *creator, size_t count)
: mCreator(creator) : mType(Type_Normal)
, mCount(count)
, mFlags(0) , mFlags(0)
, mType(Type_Normal) , mCreator(creator)
, mCount(count)
, mBase(base) , mBase(base)
{ {
if (base.getClass().getEnchantment(base) != "") if (base.getClass().getEnchantment(base) != "")
@ -59,10 +59,10 @@ namespace MWGui
} }
ItemStack::ItemStack() ItemStack::ItemStack()
: mCreator(NULL) : mType(Type_Normal)
, mCount(0)
, mFlags(0) , mFlags(0)
, mType(Type_Normal) , mCreator(NULL)
, mCount(0)
{ {
} }

@ -19,9 +19,9 @@ namespace MWGui
{ {
JailScreen::JailScreen() JailScreen::JailScreen()
: WindowBase("openmw_jail_screen.layout"), : WindowBase("openmw_jail_screen.layout"),
mTimeAdvancer(0.01f),
mDays(1), mDays(1),
mFadeTimeRemaining(0) mFadeTimeRemaining(0),
mTimeAdvancer(0.01f)
{ {
getWidget(mProgressBar, "ProgressBar"); getWidget(mProgressBar, "ProgressBar");

@ -68,8 +68,8 @@ namespace
AddJournalEntry (MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style, AddJournalEntry (MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style,
MWGui::BookTypesetter::Style* header_style, bool add_header) : MWGui::BookTypesetter::Style* header_style, bool add_header) :
AddEntry (typesetter, body_style), AddEntry (typesetter, body_style),
mHeaderStyle (header_style), mAddHeader (add_header),
mAddHeader (add_header) mHeaderStyle (header_style)
{ {
} }
@ -94,7 +94,7 @@ namespace
AddTopicEntry (MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style, AddTopicEntry (MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style,
MWGui::BookTypesetter::Style* header_style, intptr_t contentId) : MWGui::BookTypesetter::Style* header_style, intptr_t contentId) :
AddEntry (typesetter, body_style), mHeaderStyle (header_style), mContentId (contentId) AddEntry (typesetter, body_style), mContentId (contentId), mHeaderStyle (header_style)
{ {
} }

@ -92,7 +92,7 @@ struct JournalViewModelImpl : JournalViewModel
JournalViewModelImpl const * mModel; JournalViewModelImpl const * mModel;
BaseEntry (JournalViewModelImpl const * model, iterator_t itr) : BaseEntry (JournalViewModelImpl const * model, iterator_t itr) :
mModel (model), itr (itr), loaded (false) itr (itr), mModel (model), loaded (false)
{} {}
virtual ~BaseEntry () {} virtual ~BaseEntry () {}

@ -32,11 +32,11 @@ namespace MWGui
{ {
LoadingScreen::LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw) LoadingScreen::LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw)
: mSceneMgr(sceneMgr) : WindowBase("openmw_loading_screen.layout")
, mSceneMgr(sceneMgr)
, mWindow(rw) , mWindow(rw)
, WindowBase("openmw_loading_screen.layout")
, mLastRenderTime(0)
, mLastWallpaperChangeTime(0) , mLastWallpaperChangeTime(0)
, mLastRenderTime(0)
, mProgress(0) , mProgress(0)
, mVSyncWasEnabled(false) , mVSyncWasEnabled(false)
{ {

@ -144,16 +144,16 @@ namespace MWGui
: mCurX(0) : mCurX(0)
, mCurY(0) , mCurY(0)
, mInterior(false) , mInterior(false)
, mFogOfWar(true)
, mLocalMap(NULL) , mLocalMap(NULL)
, mCompass(NULL)
, mPrefix() , mPrefix()
, mChanged(true) , mChanged(true)
, mFogOfWar(true)
, mMapWidgetSize(0)
, mCustomMarkers(markers)
, mMarkerUpdateTimer(0.0f)
, mLastDirectionX(0.0f) , mLastDirectionX(0.0f)
, mLastDirectionY(0.0f) , mLastDirectionY(0.0f)
, mCompass(NULL)
, mMarkerUpdateTimer(0.0f)
, mCustomMarkers(markers)
, mMapWidgetSize(0)
{ {
mCustomMarkers.eventMarkersChanged += MyGUI::newDelegate(this, &LocalMapBase::updateCustomMarkers); mCustomMarkers.eventMarkersChanged += MyGUI::newDelegate(this, &LocalMapBase::updateCustomMarkers);
} }
@ -550,16 +550,16 @@ namespace MWGui
MapWindow::MapWindow(CustomMarkerCollection &customMarkers, DragAndDrop* drag, const std::string& cacheDir) MapWindow::MapWindow(CustomMarkerCollection &customMarkers, DragAndDrop* drag, const std::string& cacheDir)
: WindowPinnableBase("openmw_map_window.layout") : WindowPinnableBase("openmw_map_window.layout")
, NoDrop(drag, mMainWidget)
, LocalMapBase(customMarkers) , LocalMapBase(customMarkers)
, mGlobal(false) , NoDrop(drag, mMainWidget)
, mGlobalMap(0) , mGlobalMap(0)
, mGlobalMapRender(0)
, mEditNoteDialog()
, mEventBoxGlobal(NULL)
, mEventBoxLocal(NULL)
, mGlobalMapImage(NULL) , mGlobalMapImage(NULL)
, mGlobalMapOverlay(NULL) , mGlobalMapOverlay(NULL)
, mGlobal(false)
, mEventBoxGlobal(NULL)
, mEventBoxLocal(NULL)
, mGlobalMapRender(0)
, mEditNoteDialog()
{ {
static bool registered = false; static bool registered = false;
if (!registered) if (!registered)

@ -161,10 +161,10 @@ namespace MWGui
MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message) MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message)
: Layout("openmw_messagebox.layout") : Layout("openmw_messagebox.layout")
, mMessageBoxManager(parMessageBoxManager)
, mMessage(message)
, mCurrentTime(0) , mCurrentTime(0)
, mMaxTime(0) , mMaxTime(0)
, mMessageBoxManager(parMessageBoxManager)
, mMessage(message)
{ {
// defines // defines
mBottomPadding = 48; mBottomPadding = 48;
@ -195,8 +195,8 @@ namespace MWGui
InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons) InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons)
: WindowModal("openmw_interactive_messagebox.layout") : WindowModal("openmw_interactive_messagebox.layout")
, mMessageBoxManager(parMessageBoxManager) , mMessageBoxManager(parMessageBoxManager)
, mTextButtonPadding(0)
, mButtonPressed(-1) , mButtonPressed(-1)
, mTextButtonPadding(0)
{ {
WindowModal::open(); WindowModal::open();

@ -70,9 +70,9 @@ namespace MWGui
SortFilterItemModel::SortFilterItemModel(ItemModel *sourceModel) SortFilterItemModel::SortFilterItemModel(ItemModel *sourceModel)
: mCategory(Category_All) : mCategory(Category_All)
, mFilter(0)
, mShowEquipped(true) , mShowEquipped(true)
, mSortByType(true) , mSortByType(true)
, mFilter(0)
{ {
mSourceModel = sourceModel; mSourceModel = sourceModel;
} }

@ -23,8 +23,8 @@ namespace MWGui
SpellBuyingWindow::SpellBuyingWindow() : SpellBuyingWindow::SpellBuyingWindow() :
WindowBase("openmw_spell_buying_window.layout") WindowBase("openmw_spell_buying_window.layout")
, mCurrentY(0)
, mLastPos(0) , mLastPos(0)
, mCurrentY(0)
{ {
setCoord(0, 0, 450, 300); setCoord(0, 0, 450, 300);

@ -483,15 +483,15 @@ namespace MWGui
EffectEditorBase::EffectEditorBase(Type type) EffectEditorBase::EffectEditorBase(Type type)
: mAddEffectDialog() : mAvailableEffectsList(NULL)
, mAvailableEffectsList(NULL)
, mUsedEffectsView(NULL) , mUsedEffectsView(NULL)
, mAddEffectDialog()
, mSelectAttributeDialog(NULL) , mSelectAttributeDialog(NULL)
, mSelectSkillDialog(NULL) , mSelectSkillDialog(NULL)
, mSelectedEffect(0) , mSelectedEffect(0)
, mSelectedKnownEffectId(0) , mSelectedKnownEffectId(0)
, mType(type)
, mConstantEffect(false) , mConstantEffect(false)
, mType(type)
{ {
mAddEffectDialog.eventEffectAdded += MyGUI::newDelegate(this, &EffectEditorBase::onEffectAdded); mAddEffectDialog.eventEffectAdded += MyGUI::newDelegate(this, &EffectEditorBase::onEffectAdded);
mAddEffectDialog.eventEffectModified += MyGUI::newDelegate(this, &EffectEditorBase::onEffectModified); mAddEffectDialog.eventEffectModified += MyGUI::newDelegate(this, &EffectEditorBase::onEffectModified);

@ -30,15 +30,15 @@ namespace MWGui
ToolTips::ToolTips() : ToolTips::ToolTips() :
Layout("openmw_tooltips.layout") Layout("openmw_tooltips.layout")
, mFullHelp(false)
, mEnabled(true)
, mFocusToolTipX(0.0) , mFocusToolTipX(0.0)
, mFocusToolTipY(0.0) , mFocusToolTipY(0.0)
, mHorizontalScrollIndex(0)
, mDelay(0.0) , mDelay(0.0)
, mRemainingDelay(0.0) , mRemainingDelay(0.0)
, mLastMouseX(0) , mLastMouseX(0)
, mLastMouseY(0) , mLastMouseY(0)
, mHorizontalScrollIndex(0) , mEnabled(true)
, mFullHelp(false)
{ {
getWidget(mDynamicToolTipBox, "DynamicToolTipBox"); getWidget(mDynamicToolTipBox, "DynamicToolTipBox");

@ -50,13 +50,13 @@ namespace MWGui
WaitDialog::WaitDialog() WaitDialog::WaitDialog()
: WindowBase("openmw_wait_dialog.layout") : WindowBase("openmw_wait_dialog.layout")
, mProgressBar()
, mTimeAdvancer(0.05f) , mTimeAdvancer(0.05f)
, mSleeping(false) , mSleeping(false)
, mHours(1) , mHours(1)
, mManualHours(1) , mManualHours(1)
, mFadeTimeRemaining(0) , mFadeTimeRemaining(0)
, mInterruptAt(-1) , mInterruptAt(-1)
, mProgressBar()
{ {
getWidget(mDateTimeText, "DateTimeText"); getWidget(mDateTimeText, "DateTimeText");
getWidget(mRestText, "RestText"); getWidget(mRestText, "RestText");

@ -78,7 +78,7 @@ void WindowModal::close()
} }
NoDrop::NoDrop(DragAndDrop *drag, MyGUI::Widget *widget) NoDrop::NoDrop(DragAndDrop *drag, MyGUI::Widget *widget)
: mDrag(drag), mWidget(widget), mTransparent(false) : mWidget(widget), mDrag(drag), mTransparent(false)
{ {
if (!mWidget) if (!mWidget)
throw std::runtime_error("NoDrop needs a non-NULL widget!"); throw std::runtime_error("NoDrop needs a non-NULL widget!");

@ -13,7 +13,7 @@
#include "steering.hpp" #include "steering.hpp"
MWMechanics::AiAvoidDoor::AiAvoidDoor(const MWWorld::Ptr& doorPtr) MWMechanics::AiAvoidDoor::AiAvoidDoor(const MWWorld::Ptr& doorPtr)
: AiPackage(), mDoorPtr(doorPtr), mDuration(1), mAdjAngle(0) : AiPackage(), mDuration(1), mDoorPtr(doorPtr), mAdjAngle(0)
{ {
} }

@ -111,17 +111,17 @@ namespace MWMechanics
mTimerAttack(0), mTimerAttack(0),
mTimerReact(0), mTimerReact(0),
mTimerCombatMove(0), mTimerCombatMove(0),
mReadyToAttack(false),
mAttack(false), mAttack(false),
mFollowTarget(false), mFollowTarget(false),
mCombatMove(false), mCombatMove(false),
mReadyToAttack(false), mLastTargetPos(0,0,0),
mForceNoShortcut(false),
mCell(NULL), mCell(NULL),
mCurrentAction(), mCurrentAction(),
mActionCooldown(0), mActionCooldown(0),
mStrength(), mStrength(),
mMinMaxAttackDurationInitialised(false), mMinMaxAttackDurationInitialised(false),
mLastTargetPos(0,0,0), mForceNoShortcut(false),
mLastActorPos(0,0,0), mLastActorPos(0,0,0),
mMovement(){} mMovement(){}
}; };

@ -49,12 +49,11 @@ namespace MWMechanics
} }
AiEscort::AiEscort(const ESM::AiSequence::AiEscort *escort) AiEscort::AiEscort(const ESM::AiSequence::AiEscort *escort)
: mActorId(escort->mTargetId), mX(escort->mData.mX), mY(escort->mData.mY), mZ(escort->mData.mZ) : mActorId(escort->mTargetId), mCellId(escort->mCellId), mX(escort->mData.mX), mY(escort->mData.mY), mZ(escort->mData.mZ)
, mMaxDist(450)
, mRemainingDuration(escort->mRemainingDuration)
, mCellX(std::numeric_limits<int>::max()) , mCellX(std::numeric_limits<int>::max())
, mCellY(std::numeric_limits<int>::max()) , mCellY(std::numeric_limits<int>::max())
, mCellId(escort->mCellId)
, mRemainingDuration(escort->mRemainingDuration)
, mMaxDist(450)
{ {
} }

@ -32,27 +32,27 @@ int AiFollow::mFollowIndexCounter = 0;
AiFollow::AiFollow(const std::string &actorId,float duration, float x, float y, float z) AiFollow::AiFollow(const std::string &actorId,float duration, float x, float y, float z)
: mAlwaysFollow(false), mCommanded(false), mRemainingDuration(duration), mX(x), mY(y), mZ(z) : mAlwaysFollow(false), mCommanded(false), mRemainingDuration(duration), mX(x), mY(y), mZ(z)
, mActorRefId(actorId), mCellId(""), mActorId(-1), mFollowIndex(mFollowIndexCounter++), mActive(false) , mActorRefId(actorId), mActorId(-1), mCellId(""), mActive(false), mFollowIndex(mFollowIndexCounter++)
{ {
} }
AiFollow::AiFollow(const std::string &actorId,const std::string &cellId,float duration, float x, float y, float z) AiFollow::AiFollow(const std::string &actorId,const std::string &cellId,float duration, float x, float y, float z)
: mAlwaysFollow(false), mCommanded(false), mRemainingDuration(duration), mX(x), mY(y), mZ(z) : mAlwaysFollow(false), mCommanded(false), mRemainingDuration(duration), mX(x), mY(y), mZ(z)
, mActorRefId(actorId), mCellId(cellId), mActorId(-1), mFollowIndex(mFollowIndexCounter++), mActive(false) , mActorRefId(actorId), mActorId(-1), mCellId(cellId), mActive(false), mFollowIndex(mFollowIndexCounter++)
{ {
} }
AiFollow::AiFollow(const std::string &actorId, bool commanded) AiFollow::AiFollow(const std::string &actorId, bool commanded)
: mAlwaysFollow(true), mCommanded(commanded), mRemainingDuration(0), mX(0), mY(0), mZ(0) : mAlwaysFollow(true), mCommanded(commanded), mRemainingDuration(0), mX(0), mY(0), mZ(0)
, mActorRefId(actorId), mCellId(""), mActorId(-1), mFollowIndex(mFollowIndexCounter++), mActive(false) , mActorRefId(actorId), mActorId(-1), mCellId(""), mActive(false), mFollowIndex(mFollowIndexCounter++)
{ {
} }
AiFollow::AiFollow(const ESM::AiSequence::AiFollow *follow) AiFollow::AiFollow(const ESM::AiSequence::AiFollow *follow)
: mAlwaysFollow(follow->mAlwaysFollow), mRemainingDuration(follow->mRemainingDuration) : mAlwaysFollow(follow->mAlwaysFollow), mCommanded(follow->mCommanded), mRemainingDuration(follow->mRemainingDuration)
, mX(follow->mData.mX), mY(follow->mData.mY), mZ(follow->mData.mZ) , mX(follow->mData.mX), mY(follow->mData.mY), mZ(follow->mData.mZ)
, mActorRefId(follow->mTargetId), mActorId(-1), mCellId(follow->mCellId) , mActorRefId(follow->mTargetId), mActorId(-1)
, mCommanded(follow->mCommanded), mFollowIndex(mFollowIndexCounter++), mActive(follow->mActive) , mCellId(follow->mCellId), mActive(follow->mActive), mFollowIndex(mFollowIndexCounter++)
{ {
} }

@ -786,10 +786,10 @@ namespace MWMechanics
AiWander::AiWander (const ESM::AiSequence::AiWander* wander) AiWander::AiWander (const ESM::AiSequence::AiWander* wander)
: mDistance(wander->mData.mDistance) : mDistance(wander->mData.mDistance)
, mDuration(wander->mData.mDuration) , mDuration(wander->mData.mDuration)
, mStartTime(MWWorld::TimeStamp(wander->mStartTime))
, mTimeOfDay(wander->mData.mTimeOfDay) , mTimeOfDay(wander->mData.mTimeOfDay)
, mRepeat(wander->mData.mShouldRepeat != 0) , mRepeat(wander->mData.mShouldRepeat != 0)
, mStoredInitialActorPosition(wander->mStoredInitialActorPosition) , mStoredInitialActorPosition(wander->mStoredInitialActorPosition)
, mStartTime(MWWorld::TimeStamp(wander->mStartTime))
{ {
if (mStoredInitialActorPosition) if (mStoredInitialActorPosition)
mInitialActorPosition = wander->mInitialActorPosition; mInitialActorPosition = wander->mInitialActorPosition;

@ -642,8 +642,8 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
, mJumpState(JumpState_None) , mJumpState(JumpState_None)
, mWeaponType(WeapType_None) , mWeaponType(WeapType_None)
, mSkipAnim(false) , mSkipAnim(false)
, mSecondsOfRunning(0)
, mSecondsOfSwimming(0) , mSecondsOfSwimming(0)
, mSecondsOfRunning(0)
, mTurnAnimationThreshold(0) , mTurnAnimationThreshold(0)
{ {
if(!mAnimation) if(!mAnimation)

@ -15,16 +15,12 @@ namespace MWMechanics
int CreatureStats::sActorId = 0; int CreatureStats::sActorId = 0;
CreatureStats::CreatureStats() CreatureStats::CreatureStats()
: mLevel (0), mDead (false), mDied (false), mMurdered(false), mFriendlyHits (0), : mDrawState (DrawState_Nothing), mDead (false), mDied (false), mMurdered(false), mFriendlyHits (0),
mTalkedTo (false), mAlarmed (false), mTalkedTo (false), mAlarmed (false), mAttacked (false), mAttackingOrSpell(false),
mAttacked (false), mKnockdown(false), mKnockdownOneFrame(false), mKnockdownOverOneFrame(false),
mAttackingOrSpell(false), mHitRecovery(false), mBlock(false), mMovementFlags(0), mAttackStrength(0.f),
mIsWerewolf(false), mFallHeight(0), mRecalcMagicka(false), mLastRestock(0,0), mGoldPool(0), mActorId(-1),
mFallHeight(0), mRecalcMagicka(false), mKnockdown(false), mKnockdownOneFrame(false), mDeathAnimation(0), mIsWerewolf(false), mLevel (0)
mKnockdownOverOneFrame(false), mHitRecovery(false), mBlock(false),
mMovementFlags(0), mDrawState (DrawState_Nothing), mAttackStrength(0.f),
mLastRestock(0,0), mGoldPool(0), mActorId(-1),
mDeathAnimation(0)
{ {
for (int i=0; i<4; ++i) for (int i=0; i<4; ++i)
mAiSettings[i] = 0; mAiSettings[i] = 0;

@ -25,12 +25,12 @@
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
MWMechanics::NpcStats::NpcStats() MWMechanics::NpcStats::NpcStats()
: mBounty (0) : mDisposition (0)
, mLevelProgress(0)
, mDisposition(0)
, mReputation(0) , mReputation(0)
, mCrimeId(-1) , mCrimeId(-1)
, mBounty(0)
, mWerewolfKills (0) , mWerewolfKills (0)
, mLevelProgress(0)
, mTimeToStartDrowning(20.0) , mTimeToStartDrowning(20.0)
{ {
mSkillIncreases.resize (ESM::Attribute::Length, 0); mSkillIncreases.resize (ESM::Attribute::Length, 0);

@ -63,10 +63,10 @@ namespace MWMechanics
ObstacleCheck::ObstacleCheck(): ObstacleCheck::ObstacleCheck():
mPrevX(0) // to see if the moved since last time mPrevX(0) // to see if the moved since last time
, mPrevY(0) , mPrevY(0)
, mDistSameSpot(-1) // avoid calculating it each time
, mWalkState(State_Norm) , mWalkState(State_Norm)
, mStuckDuration(0) , mStuckDuration(0)
, mEvadeDuration(0) , mEvadeDuration(0)
, mDistSameSpot(-1) // avoid calculating it each time
{ {
} }

@ -51,12 +51,12 @@ namespace MWMechanics
{ {
PathgridGraph::PathgridGraph() PathgridGraph::PathgridGraph()
: mCell(NULL) : mCell(NULL)
, mIsGraphConstructed(false)
, mPathgrid(NULL) , mPathgrid(NULL)
, mIsExterior(0)
, mGraph(0) , mGraph(0)
, mIsGraphConstructed(false)
, mSCCId(0) , mSCCId(0)
, mSCCIndex(0) , mSCCIndex(0)
, mIsExterior(0)
{ {
} }

@ -25,10 +25,11 @@ namespace MWRender
GlobalMap::GlobalMap(const std::string &cacheDir) GlobalMap::GlobalMap(const std::string &cacheDir)
: mCacheDir(cacheDir) : mCacheDir(cacheDir)
, mMinX(0), mMaxX(0)
, mMinY(0), mMaxY(0)
, mWidth(0) , mWidth(0)
, mHeight(0) , mHeight(0)
, mMinX(0), mMaxX(0)
, mMinY(0), mMaxY(0)
{ {
mCellSize = Settings::Manager::getInt("global map cell size", "Map"); mCellSize = Settings::Manager::getInt("global map cell size", "Map");
} }

@ -186,10 +186,10 @@ void PlaneReflection::setVisibilityMask (int flags)
Water::Water (Ogre::Camera *camera, RenderingManager* rend, const MWWorld::Fallback* fallback) : Water::Water (Ogre::Camera *camera, RenderingManager* rend, const MWWorld::Fallback* fallback) :
mCamera (camera), mSceneMgr (camera->getSceneManager()), mCamera (camera), mSceneMgr (camera->getSceneManager()),
mIsUnderwater(false), mVisibilityFlags(0), mIsUnderwater(false), mActive(1),
mActive(1), mToggled(1), mToggled(1), mWaterTimer(0.f),
mRendering(rend), mRendering(rend),
mWaterTimer(0.f), mVisibilityFlags(0),
mReflection(NULL), mReflection(NULL),
mRefraction(NULL), mRefraction(NULL),
mSimulation(NULL), mSimulation(NULL),

@ -505,7 +505,10 @@ namespace MWScript
boost::shared_ptr<MWWorld::Action> action = (ptr.getClass().activate(ptr, actor)); boost::shared_ptr<MWWorld::Action> action = (ptr.getClass().activate(ptr, actor));
action->execute (actor); action->execute (actor);
if (mActivated == ptr) if (mActivated == ptr)
{
mActivationHandled = true; mActivationHandled = true;
mActivated = MWWorld::Ptr();
}
} }
float InterpreterContext::getSecondsPassed() const float InterpreterContext::getSecondsPassed() const

@ -370,18 +370,17 @@ namespace MWScript
// another morrowind oddity: player will be moved to the exterior cell at this location, // another morrowind oddity: player will be moved to the exterior cell at this location,
// non-player actors will move within the cell they are in. // non-player actors will move within the cell they are in.
MWWorld::Ptr updated;
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr()) if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
{ {
MWWorld::CellStore* cell = MWBase::Environment::get().getWorld()->getExterior(cx,cy); MWWorld::CellStore* cell = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
MWBase::Environment::get().getWorld()->moveObject(ptr,cell,x,y,z); MWBase::Environment::get().getWorld()->moveObject(ptr,cell,x,y,z);
updated = MWWorld::Ptr(ptr.getBase(), cell); ptr = MWWorld::Ptr(ptr.getBase(), cell);
} }
else else
{ {
updated = MWBase::Environment::get().getWorld()->moveObject(ptr, x, y, z); ptr = MWBase::Environment::get().getWorld()->moveObject(ptr, x, y, z);
} }
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(updated); dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(ptr);
float ax = Ogre::Radian(ptr.getRefData().getPosition().rot[0]).valueDegrees(); float ax = Ogre::Radian(ptr.getRefData().getPosition().rot[0]).valueDegrees();
float ay = Ogre::Radian(ptr.getRefData().getPosition().rot[1]).valueDegrees(); float ay = Ogre::Radian(ptr.getRefData().getPosition().rot[1]).valueDegrees();

@ -33,13 +33,13 @@ namespace MWSound
, mMasterVolume(1.0f) , mMasterVolume(1.0f)
, mSFXVolume(1.0f) , mSFXVolume(1.0f)
, mMusicVolume(1.0f) , mMusicVolume(1.0f)
, mFootstepsVolume(1.0f)
, mVoiceVolume(1.0f) , mVoiceVolume(1.0f)
, mPausedSoundTypes(0) , mFootstepsVolume(1.0f)
, mListenerUnderwater(false)
, mListenerPos(0,0,0) , mListenerPos(0,0,0)
, mListenerDir(1,0,0) , mListenerDir(1,0,0)
, mListenerUp(0,0,1) , mListenerUp(0,0,1)
, mListenerUnderwater(false) , mPausedSoundTypes(0)
{ {
if(!useSound) if(!useSound)
return; return;

@ -11,7 +11,7 @@ const MWWorld::Ptr& MWWorld::Action::getTarget() const
return mTarget; return mTarget;
} }
MWWorld::Action::Action (bool keepSound, const Ptr& target) : mKeepSound (keepSound), mTarget (target), mSoundOffset(0) MWWorld::Action::Action (bool keepSound, const Ptr& target) : mKeepSound (keepSound), mSoundOffset(0), mTarget (target)
{} {}
MWWorld::Action::~Action() {} MWWorld::Action::~Action() {}

@ -9,8 +9,8 @@ namespace MWWorld
EsmLoader::EsmLoader(MWWorld::ESMStore& store, std::vector<ESM::ESMReader>& readers, EsmLoader::EsmLoader(MWWorld::ESMStore& store, std::vector<ESM::ESMReader>& readers,
ToUTF8::Utf8Encoder* encoder, Loading::Listener& listener) ToUTF8::Utf8Encoder* encoder, Loading::Listener& listener)
: ContentLoader(listener) : ContentLoader(listener)
, mStore(store)
, mEsm(readers) , mEsm(readers)
, mStore(store)
, mEncoder(encoder) , mEncoder(encoder)
{ {
} }

@ -96,10 +96,10 @@ void MWWorld::InventoryStore::readEquipmentState(const MWWorld::ContainerStoreIt
} }
MWWorld::InventoryStore::InventoryStore() MWWorld::InventoryStore::InventoryStore()
: mSelectedEnchantItem(end()) : mListener(NULL)
, mUpdatesEnabled (true) , mUpdatesEnabled (true)
, mFirstAutoEquip(true) , mFirstAutoEquip(true)
, mListener(NULL) , mSelectedEnchantItem(end())
, mRechargingItemsUpToDate(false) , mRechargingItemsUpToDate(false)
{ {
initSlots (mSlots); initSlots (mSlots);
@ -107,12 +107,12 @@ MWWorld::InventoryStore::InventoryStore()
MWWorld::InventoryStore::InventoryStore (const InventoryStore& store) MWWorld::InventoryStore::InventoryStore (const InventoryStore& store)
: ContainerStore (store) : ContainerStore (store)
, mSelectedEnchantItem(end())
, mMagicEffects(store.mMagicEffects) , mMagicEffects(store.mMagicEffects)
, mFirstAutoEquip(store.mFirstAutoEquip)
, mListener(store.mListener) , mListener(store.mListener)
, mUpdatesEnabled(store.mUpdatesEnabled) , mUpdatesEnabled(store.mUpdatesEnabled)
, mFirstAutoEquip(store.mFirstAutoEquip)
, mPermanentMagicEffectMagnitudes(store.mPermanentMagicEffectMagnitudes) , mPermanentMagicEffectMagnitudes(store.mPermanentMagicEffectMagnitudes)
, mSelectedEnchantItem(end())
, mRechargingItemsUpToDate(false) , mRechargingItemsUpToDate(false)
{ {
copySlots (store); copySlots (store);

@ -499,7 +499,7 @@ namespace MWWorld
PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend) : PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend) :
mRender(_rend), mEngine(0), mTimeAccum(0.0f), mWaterEnabled(false), mWaterHeight(0) mRender(_rend), mEngine(0), mTimeAccum(0.0f), mWaterHeight(0), mWaterEnabled(false)
{ {
// Create physics. shapeLoader is deleted by the physic engine // Create physics. shapeLoader is deleted by the physic engine
NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader(); NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader();

@ -32,10 +32,10 @@ namespace MWWorld
Player::Player (const ESM::NPC *player, const MWBase::World& world) Player::Player (const ESM::NPC *player, const MWBase::World& world)
: mCellStore(0), : mCellStore(0),
mLastKnownExteriorPosition(0,0,0), mLastKnownExteriorPosition(0,0,0),
mMarkedCell(NULL),
mAutoMove(false), mAutoMove(false),
mForwardBackward(0), mForwardBackward(0),
mTeleported(false), mTeleported(false),
mMarkedCell(NULL),
mCurrentCrimeId(-1), mCurrentCrimeId(-1),
mPaidCrimeId(-1) mPaidCrimeId(-1)
{ {

@ -37,7 +37,7 @@ namespace MWWorld
} }
RefData::RefData() RefData::RefData()
: mBaseNode(0), mHasLocals (false), mEnabled (true), mCount (1), mCustomData (0), mChanged(false), mDeleted(false) : mBaseNode(0), mDeleted(false), mHasLocals (false), mEnabled (true), mCount (1), mCustomData (0), mChanged(false)
{ {
for (int i=0; i<3; ++i) for (int i=0; i<3; ++i)
{ {
@ -48,10 +48,10 @@ namespace MWWorld
} }
RefData::RefData (const ESM::CellRef& cellRef) RefData::RefData (const ESM::CellRef& cellRef)
: mBaseNode(0), mHasLocals (false), mEnabled (true), mCount (1), mPosition (cellRef.mPos), : mBaseNode(0), mDeleted(false), mHasLocals (false), mEnabled (true),
mCount (1), mPosition (cellRef.mPos),
mCustomData (0), mCustomData (0),
mChanged(false), // Loading from ESM/ESP files -> assume unchanged mChanged(false) // Loading from ESM/ESP files -> assume unchanged
mDeleted(false)
{ {
mLocalRotation.rot[0]=0; mLocalRotation.rot[0]=0;
mLocalRotation.rot[1]=0; mLocalRotation.rot[1]=0;
@ -59,10 +59,12 @@ namespace MWWorld
} }
RefData::RefData (const ESM::ObjectState& objectState) RefData::RefData (const ESM::ObjectState& objectState)
: mBaseNode (0), mHasLocals (false), mEnabled (objectState.mEnabled != 0), : mBaseNode (0), mDeleted(false), mHasLocals (false),
mCount (objectState.mCount), mPosition (objectState.mPosition), mCustomData (0), mEnabled (objectState.mEnabled != 0),
mChanged(true), // Loading from a savegame -> assume changed mCount (objectState.mCount),
mDeleted(false) mPosition (objectState.mPosition),
mCustomData (0),
mChanged(true) // Loading from a savegame -> assume changed
{ {
for (int i=0; i<3; ++i) for (int i=0; i<3; ++i)
mLocalRotation.rot[i] = objectState.mLocalRotation[i]; mLocalRotation.rot[i] = objectState.mLocalRotation[i];

@ -114,11 +114,10 @@ float WeatherManager::calculateAngleFade (const std::string& moonName, float ang
} }
WeatherManager::WeatherManager(MWRender::RenderingManager* rendering,MWWorld::Fallback* fallback) : WeatherManager::WeatherManager(MWRender::RenderingManager* rendering,MWWorld::Fallback* fallback) :
mHour(14), mCurrentWeather("clear"), mNextWeather(""), mFirstUpdate(true), mHour(14), mWindSpeed(0.f), mIsStorm(false), mStormDirection(0,1,0), mFallback(fallback),
mWeatherUpdateTime(0), mThunderFlash(0), mThunderChance(0), mRendering(rendering), mCurrentWeather("clear"), mNextWeather(""), mFirstUpdate(true),
mThunderChanceNeeded(50), mThunderSoundDelay(0), mRemainingTransitionTime(0), mRemainingTransitionTime(0), mThunderFlash(0), mThunderChance(0), mThunderChanceNeeded(50),
mTimePassed(0), mFallback(fallback), mWindSpeed(0.f), mRendering(rendering), mIsStorm(false), mTimePassed(0), mWeatherUpdateTime(0), mThunderSoundDelay(0)
mStormDirection(0,1,0)
{ {
//Globals //Globals
mThunderSoundID0 = mFallback->getFallbackString("Weather_Thunderstorm_Thunder_Sound_ID_0"); mThunderSoundID0 = mFallback->getFallbackString("Weather_Thunderstorm_Thunder_Sound_ID_0");

@ -147,14 +147,12 @@ namespace MWWorld
const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir, const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir,
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap, ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap,
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript) int activationDistanceOverride, const std::string& startCell, const std::string& startupScript)
: mPlayer (0), mLocalScripts (mStore), : mFallback(fallbackMap), mPlayer (0), mLocalScripts (mStore),
mSky (true), mCells (mStore, mEsm), mSky (true), mCells (mStore, mEsm),
mActivationDistanceOverride (activationDistanceOverride), mGodMode(false), mScriptsEnabled(true), mContentFiles (contentFiles),
mFallback(fallbackMap), mTeleportEnabled(true), mLevitationEnabled(true), mActivationDistanceOverride (activationDistanceOverride), mStartupScript(startupScript),
mGodMode(false), mContentFiles (contentFiles), mStartCell (startCell), mTeleportEnabled(true),
mGoToJail(false), mDaysInPrison(0), mLevitationEnabled(true), mGoToJail(false), mDaysInPrison(0)
mStartCell (startCell), mStartupScript(startupScript),
mScriptsEnabled(true)
{ {
mPhysics = new PhysicsSystem(renderer); mPhysics = new PhysicsSystem(renderer);
mPhysEngine = mPhysics->getEngine(); mPhysEngine = mPhysics->getEngine();
@ -1108,7 +1106,7 @@ namespace MWWorld
} }
} }
void World::moveObject(const Ptr &ptr, CellStore* newCell, float x, float y, float z) MWWorld::Ptr World::moveObject(const Ptr &ptr, CellStore* newCell, float x, float y, float z)
{ {
ESM::Position pos = ptr.getRefData().getPosition(); ESM::Position pos = ptr.getRefData().getPosition();
@ -1123,6 +1121,7 @@ namespace MWWorld
CellStore *currCell = ptr.isInCell() ? ptr.getCell() : NULL; // currCell == NULL should only happen for player, during initial startup CellStore *currCell = ptr.isInCell() ? ptr.getCell() : NULL; // currCell == NULL should only happen for player, during initial startup
bool isPlayer = ptr == mPlayer->getPlayer(); bool isPlayer = ptr == mPlayer->getPlayer();
bool haveToMove = isPlayer || (currCell && mWorldScene->isCellActive(*currCell)); bool haveToMove = isPlayer || (currCell && mWorldScene->isCellActive(*currCell));
MWWorld::Ptr newPtr = ptr;
if (currCell != newCell) if (currCell != newCell)
{ {
@ -1140,6 +1139,7 @@ namespace MWWorld
mWorldScene->changeToExteriorCell(pos, false); mWorldScene->changeToExteriorCell(pos, false);
} }
addContainerScripts (getPlayerPtr(), newCell); addContainerScripts (getPlayerPtr(), newCell);
newPtr = getPlayerPtr();
} }
else else
{ {
@ -1147,7 +1147,7 @@ namespace MWWorld
bool newCellActive = mWorldScene->isCellActive(*newCell); bool newCellActive = mWorldScene->isCellActive(*newCell);
if (!currCellActive && newCellActive) if (!currCellActive && newCellActive)
{ {
MWWorld::Ptr newPtr = ptr.getClass().copyToCell(ptr, *newCell, pos); newPtr = ptr.getClass().copyToCell(ptr, *newCell, pos);
mWorldScene->addObjectToScene(newPtr); mWorldScene->addObjectToScene(newPtr);
std::string script = newPtr.getClass().getScript(newPtr); std::string script = newPtr.getClass().getScript(newPtr);
@ -1163,23 +1163,21 @@ namespace MWWorld
removeContainerScripts (ptr); removeContainerScripts (ptr);
haveToMove = false; haveToMove = false;
MWWorld::Ptr newPtr = ptr.getClass() newPtr = ptr.getClass().copyToCell(ptr, *newCell);
.copyToCell(ptr, *newCell);
newPtr.getRefData().setBaseNode(0); newPtr.getRefData().setBaseNode(0);
} }
else if (!currCellActive && !newCellActive) else if (!currCellActive && !newCellActive)
ptr.getClass().copyToCell(ptr, *newCell); newPtr = ptr.getClass().copyToCell(ptr, *newCell);
else // both cells active else // both cells active
{ {
MWWorld::Ptr copy = newPtr = ptr.getClass().copyToCell(ptr, *newCell, pos);
ptr.getClass().copyToCell(ptr, *newCell, pos);
mRendering->updateObjectCell(ptr, copy); mRendering->updateObjectCell(ptr, newPtr);
ptr.getRefData().setBaseNode(NULL); ptr.getRefData().setBaseNode(NULL);
MWBase::Environment::get().getSoundManager()->updatePtr (ptr, copy); MWBase::Environment::get().getSoundManager()->updatePtr (ptr, newPtr);
MWBase::MechanicsManager *mechMgr = MWBase::Environment::get().getMechanicsManager(); MWBase::MechanicsManager *mechMgr = MWBase::Environment::get().getMechanicsManager();
mechMgr->updateCell(ptr, copy); mechMgr->updateCell(ptr, newPtr);
std::string script = std::string script =
ptr.getClass().getScript(ptr); ptr.getClass().getScript(ptr);
@ -1187,22 +1185,23 @@ namespace MWWorld
{ {
mLocalScripts.remove(ptr); mLocalScripts.remove(ptr);
removeContainerScripts (ptr); removeContainerScripts (ptr);
mLocalScripts.add(script, copy); mLocalScripts.add(script, newPtr);
addContainerScripts (copy, newCell); addContainerScripts (newPtr, newCell);
} }
} }
ptr.getRefData().setCount(0); ptr.getRefData().setCount(0);
} }
} }
if (haveToMove && ptr.getRefData().getBaseNode()) if (haveToMove && newPtr.getRefData().getBaseNode())
{ {
mRendering->moveObject(ptr, vec); mRendering->moveObject(newPtr, vec);
mPhysics->moveObject (ptr); mPhysics->moveObject (newPtr);
} }
if (isPlayer) if (isPlayer)
{ {
mWorldScene->playerMoved (vec); mWorldScene->playerMoved (vec);
} }
return newPtr;
} }
MWWorld::Ptr World::moveObjectImp(const Ptr& ptr, float x, float y, float z) MWWorld::Ptr World::moveObjectImp(const Ptr& ptr, float x, float y, float z)
@ -1216,11 +1215,7 @@ namespace MWWorld
cell = getExterior(cellX, cellY); cell = getExterior(cellX, cellY);
} }
moveObject(ptr, cell, x, y, z); return moveObject(ptr, cell, x, y, z);
MWWorld::Ptr updated = ptr;
updated.mCell = cell;
return updated;
} }
MWWorld::Ptr World::moveObject (const Ptr& ptr, float x, float y, float z) MWWorld::Ptr World::moveObject (const Ptr& ptr, float x, float y, float z)
@ -2942,7 +2937,7 @@ namespace MWWorld
struct AddDetectedReference struct AddDetectedReference
{ {
AddDetectedReference(std::vector<Ptr>& out, Ptr detector, World::DetectionType type, float squaredDist) AddDetectedReference(std::vector<Ptr>& out, Ptr detector, World::DetectionType type, float squaredDist)
: mOut(out), mDetector(detector), mType(type), mSquaredDist(squaredDist) : mOut(out), mDetector(detector), mSquaredDist(squaredDist), mType(type)
{ {
} }

@ -348,7 +348,9 @@ namespace MWWorld
virtual MWWorld::Ptr moveObject (const Ptr& ptr, float x, float y, float z); virtual MWWorld::Ptr moveObject (const Ptr& ptr, float x, float y, float z);
///< @return an updated Ptr in case the Ptr's cell changes ///< @return an updated Ptr in case the Ptr's cell changes
virtual void moveObject (const Ptr& ptr, CellStore* newCell, float x, float y, float z);
virtual MWWorld::Ptr moveObject (const Ptr& ptr, CellStore* newCell, float x, float y, float z);
///< @return an updated Ptr
virtual void scaleObject (const Ptr& ptr, float scale); virtual void scaleObject (const Ptr& ptr, float scale);

@ -56,8 +56,8 @@ namespace Compiler
LineParser::LineParser (ErrorHandler& errorHandler, const Context& context, Locals& locals, LineParser::LineParser (ErrorHandler& errorHandler, const Context& context, Locals& locals,
Literals& literals, std::vector<Interpreter::Type_Code>& code, bool allowExpression) Literals& literals, std::vector<Interpreter::Type_Code>& code, bool allowExpression)
: Parser (errorHandler, context), mLocals (locals), mLiterals (literals), mCode (code), : Parser (errorHandler, context), mLocals (locals), mLiterals (literals), mCode (code),
mState (BeginState), mExprParser (errorHandler, context, locals, literals), mState (BeginState), mReferenceMember(false), mButtons(0), mType(0),
mAllowExpression (allowExpression), mButtons(0), mType(0), mReferenceMember(false) mExprParser (errorHandler, context, locals, literals), mAllowExpression (allowExpression)
{} {}
bool LineParser::parseInt (int value, const TokenLoc& loc, Scanner& scanner) bool LineParser::parseInt (int value, const TokenLoc& loc, Scanner& scanner)

@ -7,7 +7,7 @@
namespace Interpreter namespace Interpreter
{ {
Runtime::Runtime() : mContext (0), mCode (0), mPC (0), mCodeSize(0) {} Runtime::Runtime() : mContext (0), mCode (0), mCodeSize(0), mPC (0) {}
int Runtime::getPC() const int Runtime::getPC() const
{ {

@ -60,21 +60,21 @@ struct AudioResampler
MovieAudioDecoder::MovieAudioDecoder(VideoState* videoState) MovieAudioDecoder::MovieAudioDecoder(VideoState* videoState)
: mVideoState(videoState) : mVideoState(videoState)
, mAVStream(*videoState->audio_st) , mAVStream(*videoState->audio_st)
, mFrame(av_frame_alloc()) , mOutputSampleFormat(AV_SAMPLE_FMT_NONE)
, mOutputChannelLayout(0)
, mOutputSampleRate(0)
, mFramePos(0) , mFramePos(0)
, mFrameSize(0) , mFrameSize(0)
, mAudioClock(0.0) , mAudioClock(0.0)
, mDataBuf(NULL)
, mFrameData(NULL)
, mDataBufLen(0)
, mFrame(av_frame_alloc())
, mAudioDiffAccum(0.0) , mAudioDiffAccum(0.0)
, mAudioDiffAvgCoef(exp(log(0.01 / AUDIO_DIFF_AVG_NB))) , mAudioDiffAvgCoef(exp(log(0.01 / AUDIO_DIFF_AVG_NB)))
/* Correct audio only if larger error than this */ /* Correct audio only if larger error than this */
, mAudioDiffThreshold(2.0 * 0.050/* 50 ms */) , mAudioDiffThreshold(2.0 * 0.050/* 50 ms */)
, mAudioDiffAvgCount(0) , mAudioDiffAvgCount(0)
, mOutputSampleFormat(AV_SAMPLE_FMT_NONE)
, mOutputSampleRate(0)
, mOutputChannelLayout(0)
, mDataBuf(NULL)
, mFrameData(NULL)
, mDataBufLen(0)
{ {
mAudioResampler.reset(new AudioResampler()); mAudioResampler.reset(new AudioResampler());
} }

@ -59,16 +59,18 @@ namespace Video
{ {
VideoState::VideoState() VideoState::VideoState()
: format_ctx(NULL), av_sync_type(AV_SYNC_DEFAULT) : mAudioFactory(NULL)
, format_ctx(NULL)
, av_sync_type(AV_SYNC_DEFAULT)
, audio_st(NULL) , audio_st(NULL)
, video_st(NULL), frame_last_pts(0.0) , video_st(NULL), frame_last_pts(0.0)
, video_clock(0.0), sws_context(NULL), rgbaFrame(NULL), pictq_size(0) , video_clock(0.0), sws_context(NULL), rgbaFrame(NULL), pictq_size(0)
, pictq_rindex(0), pictq_windex(0) , pictq_rindex(0), pictq_windex(0)
, mQuit(false), mPaused(false)
, mAudioFactory(NULL)
, mSeekRequested(false) , mSeekRequested(false)
, mSeekPos(0) , mSeekPos(0)
, mVideoEnded(false) , mVideoEnded(false)
, mPaused(false)
, mQuit(false)
{ {
mFlushPktData = flush_pkt.data; mFlushPktData = flush_pkt.data;

@ -32,9 +32,9 @@ namespace ICS
{ {
Control::Control(const std::string& name, bool autoChangeDirectionOnLimitsAfterStop, bool autoReverseToInitialValue Control::Control(const std::string& name, bool autoChangeDirectionOnLimitsAfterStop, bool autoReverseToInitialValue
, float initialValue, float stepSize, float stepsPerSeconds, bool axisBindable) , float initialValue, float stepSize, float stepsPerSeconds, bool axisBindable)
: mName(name) : mValue(initialValue)
, mValue(initialValue)
, mInitialValue(initialValue) , mInitialValue(initialValue)
, mName(name)
, mStepSize(stepSize) , mStepSize(stepSize)
, mStepsPerSeconds(stepsPerSeconds) , mStepsPerSeconds(stepsPerSeconds)
, mAutoReverseToInitialValue(autoReverseToInitialValue) , mAutoReverseToInitialValue(autoReverseToInitialValue)

@ -32,13 +32,13 @@ namespace ICS
, DetectingBindingListener* detectingBindingListener , DetectingBindingListener* detectingBindingListener
, InputControlSystemLog* log, size_t channelCount) , InputControlSystemLog* log, size_t channelCount)
: mFileName(file) : mFileName(file)
, mLog(log)
, mDetectingBindingListener(detectingBindingListener) , mDetectingBindingListener(detectingBindingListener)
, mDetectingBindingControl(NULL) , mDetectingBindingControl(NULL)
, mLog(log)
, mXmouseAxisBinded(false), mYmouseAxisBinded(false)
, mClientHeight(1)
, mClientWidth(1)
, mDetectingBindingDirection(Control::STOP) , mDetectingBindingDirection(Control::STOP)
, mXmouseAxisBinded(false), mYmouseAxisBinded(false)
, mClientWidth(1)
, mClientHeight(1)
{ {
ICS_LOG(" - Creating InputControlSystem - "); ICS_LOG(" - Creating InputControlSystem - ");
@ -539,10 +539,10 @@ namespace ICS
} }
binder.SetAttribute( "direction", "DECREASE" ); binder.SetAttribute( "direction", "DECREASE" );
control.InsertEndChild(binder); control.InsertEndChild(binder);
} }
JoystickIDList::const_iterator it = mJoystickIDList.begin(); JoystickIDList::const_iterator it = mJoystickIDList.begin();
while(it!=mJoystickIDList.end()) while(it!=mJoystickIDList.end())
{ {
int deviceID = *it; int deviceID = *it;
if(getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE) if(getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE)
!= /*NamedAxis::*/UNASSIGNED) != /*NamedAxis::*/UNASSIGNED)
@ -552,8 +552,8 @@ namespace ICS
binder.SetAttribute( "axis", ToString<int>( binder.SetAttribute( "axis", ToString<int>(
getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE)).c_str() ); getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE)).c_str() );
binder.SetAttribute( "direction", "INCREASE" ); binder.SetAttribute( "direction", "INCREASE" );
binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability
control.InsertEndChild(binder); control.InsertEndChild(binder);
@ -567,8 +567,8 @@ namespace ICS
binder.SetAttribute( "axis", ToString<int>( binder.SetAttribute( "axis", ToString<int>(
getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::DECREASE)).c_str() ); getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::DECREASE)).c_str() );
binder.SetAttribute( "direction", "DECREASE" ); binder.SetAttribute( "direction", "DECREASE" );
binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability
control.InsertEndChild(binder); control.InsertEndChild(binder);
@ -582,8 +582,8 @@ namespace ICS
binder.SetAttribute( "button", ToString<unsigned int>( binder.SetAttribute( "button", ToString<unsigned int>(
getJoystickButtonBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE)).c_str() ); getJoystickButtonBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE)).c_str() );
binder.SetAttribute( "direction", "INCREASE" ); binder.SetAttribute( "direction", "INCREASE" );
binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability
control.InsertEndChild(binder); control.InsertEndChild(binder);
@ -597,13 +597,13 @@ namespace ICS
binder.SetAttribute( "button", ToString<unsigned int>( binder.SetAttribute( "button", ToString<unsigned int>(
getJoystickButtonBinding(*o, deviceID, Control/*::ControlChangingDirection*/::DECREASE)).c_str() ); getJoystickButtonBinding(*o, deviceID, Control/*::ControlChangingDirection*/::DECREASE)).c_str() );
binder.SetAttribute( "direction", "DECREASE" ); binder.SetAttribute( "direction", "DECREASE" );
binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability
control.InsertEndChild(binder); control.InsertEndChild(binder);
} }
it++; it++;
} }

@ -10,28 +10,28 @@ namespace SFO
/// \brief General purpose wrapper for OGRE applications around SDL's event /// \brief General purpose wrapper for OGRE applications around SDL's event
/// queue, mostly used for handling input-related events. /// queue, mostly used for handling input-related events.
InputWrapper::InputWrapper(SDL_Window* window, Ogre::RenderWindow* ogreWindow, bool grab) : InputWrapper::InputWrapper(SDL_Window* window, Ogre::RenderWindow* ogreWindow, bool grab) :
mSDLWindow(window), mMouseListener(NULL),
mOgreWindow(ogreWindow), mKeyboardListener(NULL),
mWindowListener(NULL),
mConListener(NULL),
mWarpX(0),
mWarpY(0),
mWarpCompensate(false), mWarpCompensate(false),
mMouseRelative(false),
mGrabPointer(false),
mWrapPointer(false), mWrapPointer(false),
mAllowGrab(grab),
mWantMouseVisible(false),
mWantGrab(false),
mWantRelative(false),
mGrabPointer(false),
mMouseRelative(false),
mFirstMouseMove(true),
mMouseZ(0), mMouseZ(0),
mMouseY(0),
mMouseX(0), mMouseX(0),
mMouseInWindow(true), mMouseY(0),
mConListener(NULL),
mKeyboardListener(NULL),
mMouseListener(NULL),
mWindowListener(NULL),
mWindowHasFocus(true), mWindowHasFocus(true),
mWantGrab(false), mMouseInWindow(true),
mWantRelative(false), mSDLWindow(window),
mWantMouseVisible(false), mOgreWindow(ogreWindow)
mAllowGrab(grab),
mWarpX(0),
mWarpY(0),
mFirstMouseMove(true)
{ {
_setupOISKeys(); _setupOISKeys();
} }

@ -29,17 +29,17 @@ namespace sh
} }
Factory::Factory (Platform* platform) Factory::Factory (Platform* platform)
: mPlatform(platform) : mShadersEnabled(true)
, mShadersEnabled(true)
, mShaderDebugOutputEnabled(false) , mShaderDebugOutputEnabled(false)
, mCurrentLanguage(Language_None)
, mListener(NULL)
, mCurrentConfiguration(NULL)
, mCurrentLodConfiguration(NULL)
, mReadMicrocodeCache(false) , mReadMicrocodeCache(false)
, mWriteMicrocodeCache(false) , mWriteMicrocodeCache(false)
, mReadSourceCache(false) , mReadSourceCache(false)
, mWriteSourceCache(false) , mWriteSourceCache(false)
, mCurrentConfiguration(NULL)
, mCurrentLodConfiguration(NULL)
, mCurrentLanguage(Language_None)
, mListener(NULL)
, mPlatform(platform)
{ {
assert (!sThis); assert (!sThis);
sThis = this; sThis = this;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save