1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-06 00:40:04 +00:00

Merge pull request #3040 from akortunov/pvs

Fix some issues, found by PVS Studio
This commit is contained in:
Bret Curtis 2021-01-10 12:58:17 +01:00 committed by GitHub
commit a735bbe9a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 56 additions and 78 deletions

View File

@ -108,7 +108,7 @@ bool Launcher::AdvancedPage::loadSettings()
loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game"); loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game");
connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool))); connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool)));
loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game"); loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game");
if (animSourcesCheckBox->checkState()) if (animSourcesCheckBox->checkState() != Qt::Unchecked)
{ {
loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game");
loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game");

View File

@ -206,7 +206,7 @@ void Launcher::GraphicsPage::saveSettings()
if (cScreen != mEngineSettings.getInt("screen", "Video")) if (cScreen != mEngineSettings.getInt("screen", "Video"))
mEngineSettings.setInt("screen", "Video", cScreen); mEngineSettings.setInt("screen", "Video", cScreen);
if (framerateLimitCheckBox->checkState()) if (framerateLimitCheckBox->checkState() != Qt::Unchecked)
{ {
float cFpsLimit = framerateLimitSpinBox->value(); float cFpsLimit = framerateLimitSpinBox->value();
if (cFpsLimit != mEngineSettings.getFloat("framerate limit", "Video")) if (cFpsLimit != mEngineSettings.getFloat("framerate limit", "Video"))
@ -217,7 +217,7 @@ void Launcher::GraphicsPage::saveSettings()
mEngineSettings.setFloat("framerate limit", "Video", 0); mEngineSettings.setFloat("framerate limit", "Video", 0);
} }
int cShadowDist = shadowDistanceCheckBox->checkState() ? shadowDistanceSpinBox->value() : 0; int cShadowDist = shadowDistanceCheckBox->checkState() != Qt::Unchecked ? shadowDistanceSpinBox->value() : 0;
if (mEngineSettings.getInt("maximum shadow map distance", "Shadows") != cShadowDist) if (mEngineSettings.getInt("maximum shadow map distance", "Shadows") != cShadowDist)
mEngineSettings.setInt("maximum shadow map distance", "Shadows", cShadowDist); mEngineSettings.setInt("maximum shadow map distance", "Shadows", cShadowDist);
float cFadeStart = fadeStartSpinBox->value(); float cFadeStart = fadeStartSpinBox->value();

View File

@ -325,12 +325,6 @@ std::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseNAry (const Token& keyw
break; break;
} }
if (nodes.empty())
{
error();
return std::shared_ptr<Node>();
}
switch (keyword.mType) switch (keyword.mType)
{ {
case Token::Type_Keyword_And: return std::shared_ptr<CSMFilter::Node> (new AndNode (nodes)); case Token::Type_Keyword_And: return std::shared_ptr<CSMFilter::Node> (new AndNode (nodes));

View File

@ -10,7 +10,7 @@
#include "nestedtablewrapper.hpp" #include "nestedtablewrapper.hpp"
CSMWorld::PotionColumns::PotionColumns (const InventoryColumns& columns) CSMWorld::PotionColumns::PotionColumns (const InventoryColumns& columns)
: InventoryColumns (columns) {} : InventoryColumns (columns), mEffects(nullptr) {}
CSMWorld::PotionRefIdAdapter::PotionRefIdAdapter (const PotionColumns& columns, CSMWorld::PotionRefIdAdapter::PotionRefIdAdapter (const PotionColumns& columns,
const RefIdColumn *autoCalc) const RefIdColumn *autoCalc)

View File

@ -115,7 +115,7 @@ namespace CSMWorld
{ {
const RefIdColumn *mModel; const RefIdColumn *mModel;
ModelColumns (const BaseColumns& base) : BaseColumns (base) {} ModelColumns (const BaseColumns& base) : BaseColumns (base), mModel(nullptr) {}
}; };
/// \brief Adapter for IDs with models (all but levelled lists) /// \brief Adapter for IDs with models (all but levelled lists)
@ -1858,18 +1858,18 @@ namespace CSMWorld
break; // always save break; // always save
case 16: case 16:
if (content.mType == ESM::AI_Travel) if (content.mType == ESM::AI_Travel)
content.mTravel.mZ = value.toFloat(); content.mTravel.mX = value.toFloat();
else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort) else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
content.mTarget.mZ = value.toFloat(); content.mTarget.mX = value.toFloat();
else else
return; // return without saving return; // return without saving
break; // always save break; // always save
case 17: case 17:
if (content.mType == ESM::AI_Travel) if (content.mType == ESM::AI_Travel)
content.mTravel.mZ = value.toFloat(); content.mTravel.mY = value.toFloat();
else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort) else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
content.mTarget.mZ = value.toFloat(); content.mTarget.mY = value.toFloat();
else else
return; // return without saving return; // return without saving

View File

@ -438,8 +438,8 @@ void CSVDoc::View::updateActions()
for (std::vector<QAction *>::iterator iter (mEditingActions.begin()); iter!=mEditingActions.end(); ++iter) for (std::vector<QAction *>::iterator iter (mEditingActions.begin()); iter!=mEditingActions.end(); ++iter)
(*iter)->setEnabled (editing); (*iter)->setEnabled (editing);
mUndo->setEnabled (editing & mDocument->getUndoStack().canUndo()); mUndo->setEnabled (editing && mDocument->getUndoStack().canUndo());
mRedo->setEnabled (editing & mDocument->getUndoStack().canRedo()); mRedo->setEnabled (editing && mDocument->getUndoStack().canRedo());
mSave->setEnabled (!(mDocument->getState() & CSMDoc::State_Saving) && !running); mSave->setEnabled (!(mDocument->getState() & CSMDoc::State_Saving) && !running);
mVerify->setEnabled (!(mDocument->getState() & CSMDoc::State_Verifying)); mVerify->setEnabled (!(mDocument->getState() & CSMDoc::State_Verifying));

View File

@ -427,14 +427,8 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
{ {
if (i_cell == cellX && j_cell == cellY && abs(i-xHitInCell) < r && abs(j-yHitInCell) < r) if (i_cell == cellX && j_cell == cellY && abs(i-xHitInCell) < r && abs(j-yHitInCell) < r)
{ {
int distanceX(0); int distanceX = abs(i-xHitInCell);
int distanceY(0); int distanceY = abs(j-yHitInCell);
if (i_cell < cellX) distanceX = xHitInCell + landTextureSize * abs(i_cell-cellX) - i;
if (j_cell < cellY) distanceY = yHitInCell + landTextureSize * abs(j_cell-cellY) - j;
if (i_cell > cellX) distanceX = -xHitInCell + landTextureSize* abs(i_cell-cellX) + i;
if (j_cell > cellY) distanceY = -yHitInCell + landTextureSize * abs(j_cell-cellY) + j;
if (i_cell == cellX) distanceX = abs(i-xHitInCell);
if (j_cell == cellY) distanceY = abs(j-yHitInCell);
float distance = std::round(sqrt(pow(distanceX, 2)+pow(distanceY, 2))); float distance = std::round(sqrt(pow(distanceX, 2)+pow(distanceY, 2)));
float rf = static_cast<float>(mBrushSize) / 2; float rf = static_cast<float>(mBrushSize) / 2;
if (distance < rf) newTerrain[j*landTextureSize+i] = brushInt; if (distance < rf) newTerrain[j*landTextureSize+i] = brushInt;

View File

@ -20,7 +20,8 @@ CSMWorld::UniversalId CSVWorld::DragDropUtils::getAcceptedData(const QDropEvent
{ {
if (canAcceptData(event, type)) if (canAcceptData(event, type))
{ {
return getTableMimeData(event)->returnMatching(type); if (const CSMWorld::TableMimeData *data = getTableMimeData(event))
return data->returnMatching(type);
} }
return CSMWorld::UniversalId::Type_None; return CSMWorld::UniversalId::Type_None;
} }

View File

@ -19,14 +19,10 @@ void CSVWorld::DragRecordTable::startDragFromTable (const CSVWorld::DragRecordTa
} }
CSMWorld::TableMimeData* mime = new CSMWorld::TableMimeData (records, mDocument); CSMWorld::TableMimeData* mime = new CSMWorld::TableMimeData (records, mDocument);
QDrag* drag = new QDrag (this);
if (mime) drag->setMimeData (mime);
{ drag->setPixmap (QString::fromUtf8 (mime->getIcon().c_str()));
QDrag* drag = new QDrag (this); drag->exec (Qt::CopyAction);
drag->setMimeData (mime);
drag->setPixmap (QString::fromUtf8 (mime->getIcon().c_str()));
drag->exec (Qt::CopyAction);
}
} }
CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) : CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) :

View File

@ -261,16 +261,10 @@ QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleO
return dsb; return dsb;
} }
/// \todo implement size limit. QPlainTextEdit does not support a size limit.
case CSMWorld::ColumnBase::Display_LongString: case CSMWorld::ColumnBase::Display_LongString:
{
QPlainTextEdit *edit = new QPlainTextEdit(parent);
edit->setUndoRedoEnabled (false);
return edit;
}
case CSMWorld::ColumnBase::Display_LongString256: case CSMWorld::ColumnBase::Display_LongString256:
{ {
/// \todo implement size limit. QPlainTextEdit does not support a size limit.
QPlainTextEdit *edit = new QPlainTextEdit(parent); QPlainTextEdit *edit = new QPlainTextEdit(parent);
edit->setUndoRedoEnabled (false); edit->setUndoRedoEnabled (false);
return edit; return edit;

View File

@ -587,7 +587,7 @@ namespace MWGui
// effect box can have variable width -> variable left coordinate // effect box can have variable width -> variable left coordinate
int effectsDx = 0; int effectsDx = 0;
if (!mMinimapBox->getVisible ()) if (!mMinimapBox->getVisible ())
effectsDx = (viewSize.width - mMinimapBoxBaseRight) - (viewSize.width - mEffectBoxBaseRight); effectsDx = mEffectBoxBaseRight - mMinimapBoxBaseRight;
mMapVisible = mMinimapBox->getVisible (); mMapVisible = mMinimapBox->getVisible ();
if (!mMapVisible) if (!mMapVisible)

View File

@ -561,7 +561,7 @@ namespace
if (mAllQuests) if (mAllQuests)
{ {
SetNamesInactive setInactive(list); SetNamesInactive setInactive(list);
mModel->visitQuestNames(!mAllQuests, setInactive); mModel->visitQuestNames(false, setInactive);
} }
MWBase::Environment::get().getWindowManager()->playSound("book page"); MWBase::Environment::get().getWindowManager()->playSound("book page");

View File

@ -28,10 +28,7 @@ namespace MWGui
MessageBoxManager::~MessageBoxManager () MessageBoxManager::~MessageBoxManager ()
{ {
for (MessageBox* messageBox : mMessageBoxes) MessageBoxManager::clear();
{
delete messageBox;
}
} }
int MessageBoxManager::getMessagesCount() int MessageBoxManager::getMessagesCount()

View File

@ -99,7 +99,6 @@ namespace MWMechanics
{ {
AiPackage::Options options; AiPackage::Options options;
options.mUseVariableSpeed = true; options.mUseVariableSpeed = true;
options.mRepeat = false;
return options; return options;
} }

View File

@ -446,9 +446,9 @@ std::string CharacterController::fallbackShortWeaponGroup(const std::string& bas
const ESM::WeaponType* weapInfo = getWeaponType(mWeaponType); const ESM::WeaponType* weapInfo = getWeaponType(mWeaponType);
// For real two-handed melee weapons use 2h swords animations as fallback, otherwise use the 1h ones // For real two-handed melee weapons use 2h swords animations as fallback, otherwise use the 1h ones
if (isRealWeapon && weapInfo->mFlags & ESM::WeaponType::TwoHanded && weapInfo->mWeaponClass == ESM::WeaponType::Melee) if (weapInfo->mFlags & ESM::WeaponType::TwoHanded && weapInfo->mWeaponClass == ESM::WeaponType::Melee)
groupName += twoHandFallback; groupName += twoHandFallback;
else if (isRealWeapon) else
groupName += oneHandFallback; groupName += oneHandFallback;
// Special case for crossbows - we shouls apply 1h animations a fallback only for lower body // Special case for crossbows - we shouls apply 1h animations a fallback only for lower body

View File

@ -4,8 +4,6 @@
namespace MWMechanics namespace MWMechanics
{ {
static const ESM::WeaponType *sWeaponTypeListEnd = &sWeaponTypeList[sizeof(sWeaponTypeList)/sizeof(sWeaponTypeList[0])];
MWWorld::ContainerStoreIterator getActiveWeapon(MWWorld::Ptr actor, int *weaptype) MWWorld::ContainerStoreIterator getActiveWeapon(MWWorld::Ptr actor, int *weaptype)
{ {
MWWorld::InventoryStore &inv = actor.getClass().getInventoryStore(actor); MWWorld::InventoryStore &inv = actor.getClass().getInventoryStore(actor);

View File

@ -152,6 +152,9 @@ namespace MWPhysics
, mNextLOS(0) , mNextLOS(0)
, mFrameNumber(0) , mFrameNumber(0)
, mTimer(osg::Timer::instance()) , mTimer(osg::Timer::instance())
, mTimeBegin(0)
, mTimeEnd(0)
, mFrameStart(0)
{ {
mNumThreads = Config::computeNumThreads(mThreadSafeBullet); mNumThreads = Config::computeNumThreads(mThreadSafeBullet);

View File

@ -583,7 +583,7 @@ namespace MWRender
} }
mOverlayImage->copySubImage(imageDest.mX, imageDest.mY, 0, imageDest.mImage); mOverlayImage->copySubImage(imageDest.mX, imageDest.mY, 0, imageDest.mImage);
it = mPendingImageDest.erase(it); mPendingImageDest.erase(it);
return true; return true;
} }
} }

View File

@ -135,7 +135,7 @@ public:
mClipNodeTransform = new osg::Group; mClipNodeTransform = new osg::Group;
mClipNodeTransform->addCullCallback(new FlipCallback(&mPlane)); mClipNodeTransform->addCullCallback(new FlipCallback(&mPlane));
addChild(mClipNodeTransform); osg::Group::addChild(mClipNodeTransform);
mClipNode = new osg::ClipNode; mClipNode = new osg::ClipNode;
@ -240,7 +240,7 @@ public:
setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
setReferenceFrame(osg::Camera::RELATIVE_RF); setReferenceFrame(osg::Camera::RELATIVE_RF);
setSmallFeatureCullingPixelSize(Settings::Manager::getInt("small feature culling pixel size", "Water")); setSmallFeatureCullingPixelSize(Settings::Manager::getInt("small feature culling pixel size", "Water"));
setName("RefractionCamera"); osg::Camera::setName("RefractionCamera");
setCullCallback(new InheritViewPointCallback); setCullCallback(new InheritViewPointCallback);
setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
@ -261,7 +261,7 @@ public:
getOrCreateStateSet()->setAttributeAndModes(fog, osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE); getOrCreateStateSet()->setAttributeAndModes(fog, osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE);
mClipCullNode = new ClipCullNode; mClipCullNode = new ClipCullNode;
addChild(mClipCullNode); osg::Camera::addChild(mClipCullNode);
mRefractionTexture = new osg::Texture2D; mRefractionTexture = new osg::Texture2D;
mRefractionTexture->setTextureSize(rttSize, rttSize); mRefractionTexture->setTextureSize(rttSize, rttSize);
@ -335,7 +335,7 @@ public:
setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
setReferenceFrame(osg::Camera::RELATIVE_RF); setReferenceFrame(osg::Camera::RELATIVE_RF);
setSmallFeatureCullingPixelSize(Settings::Manager::getInt("small feature culling pixel size", "Water")); setSmallFeatureCullingPixelSize(Settings::Manager::getInt("small feature culling pixel size", "Water"));
setName("ReflectionCamera"); osg::Camera::setName("ReflectionCamera");
setCullCallback(new InheritViewPointCallback); setCullCallback(new InheritViewPointCallback);
setInterior(isInterior); setInterior(isInterior);
@ -364,7 +364,7 @@ public:
getOrCreateStateSet()->setAttributeAndModes(frontFace, osg::StateAttribute::ON); getOrCreateStateSet()->setAttributeAndModes(frontFace, osg::StateAttribute::ON);
mClipCullNode = new ClipCullNode; mClipCullNode = new ClipCullNode;
addChild(mClipCullNode); osg::Camera::addChild(mClipCullNode);
SceneUtil::ShadowManager::disableShadowsForStateSet(getOrCreateStateSet()); SceneUtil::ShadowManager::disableShadowsForStateSet(getOrCreateStateSet());
} }

View File

@ -120,6 +120,9 @@ MWWorld::InventoryStore::InventoryStore (const InventoryStore& store)
MWWorld::InventoryStore& MWWorld::InventoryStore::operator= (const InventoryStore& store) MWWorld::InventoryStore& MWWorld::InventoryStore::operator= (const InventoryStore& store)
{ {
if (this == &store)
return *this;
mListener = store.mListener; mListener = store.mListener;
mInventoryListener = store.mInventoryListener; mInventoryListener = store.mInventoryListener;
mMagicEffects = store.mMagicEffects; mMagicEffects = store.mMagicEffects;

View File

@ -76,7 +76,7 @@ void MWWorld::LocalScripts::startIteration()
bool MWWorld::LocalScripts::getNext(std::pair<std::string, Ptr>& script) bool MWWorld::LocalScripts::getNext(std::pair<std::string, Ptr>& script)
{ {
while (mIter!=mScripts.end()) if (mIter!=mScripts.end())
{ {
std::list<std::pair<std::string, Ptr> >::iterator iter = mIter++; std::list<std::pair<std::string, Ptr> >::iterator iter = mIter++;
script = *iter; script = *iter;

View File

@ -140,15 +140,12 @@ namespace Compiler
for (int i = 0; i <= length; i++) for (int i = 0; i <= length; i++)
{ {
if (length >= i) in.get (ch);
{
in.get (ch);
if (!in.good()) if (!in.good())
return false; return false;
mData[i] = ch; mData[i] = ch;
}
} }
mLength = length; mLength = length;

View File

@ -21,7 +21,7 @@ namespace Files
LowLevelFile mFile; LowLevelFile mFile;
char mBuffer[sBufferSize]; char mBuffer[sBufferSize]{0};
public: public:
ConstrainedFileStreamBuf(const std::string &fname, size_t start, size_t length) ConstrainedFileStreamBuf(const std::string &fname, size_t start, size_t length)

View File

@ -71,7 +71,7 @@ struct NiParticlesData : public NiGeometryData
{ {
int numParticles{0}; int numParticles{0};
int activeCount; int activeCount{0};
std::vector<float> particleRadii, sizes, rotationAngles; std::vector<float> particleRadii, sizes, rotationAngles;
std::vector<osg::Quat> rotations; std::vector<osg::Quat> rotations;
@ -119,14 +119,14 @@ struct NiPixelData : public Record
NIPXFMT_DXT5, NIPXFMT_DXT5,
NIPXFMT_DXT5_ALT NIPXFMT_DXT5_ALT
}; };
Format fmt; Format fmt{NIPXFMT_RGB8};
unsigned int colorMask[4]; unsigned int colorMask[4]{0};
unsigned int bpp, pixelTiling{0}; unsigned int bpp{0}, pixelTiling{0};
bool sRGB{false}; bool sRGB{false};
NiPalettePtr palette; NiPalettePtr palette;
unsigned int numberOfMipmaps; unsigned int numberOfMipmaps{0};
struct Mipmap struct Mipmap
{ {

View File

@ -177,7 +177,7 @@ struct Node : public Named
// NiNodes (or types derived from NiNodes) can be parents. // NiNodes (or types derived from NiNodes) can be parents.
NiNode *parent; NiNode *parent;
bool isBone; bool isBone{false};
void setBone() void setBone()
{ {
@ -378,7 +378,7 @@ struct NiCamera : Node
struct NiSwitchNode : public NiNode struct NiSwitchNode : public NiNode
{ {
unsigned int switchFlags{0}; unsigned int switchFlags{0};
unsigned int initialIndex; unsigned int initialIndex{0};
void read(NIFStream *nif) override void read(NIFStream *nif) override
{ {

View File

@ -61,7 +61,7 @@ struct NiTexturingProperty : public Property
3 - hilight // These two are for PS2 only? 3 - hilight // These two are for PS2 only?
4 - hilight2 4 - hilight2
*/ */
unsigned int apply; unsigned int apply{0};
/* /*
* The textures in this list are as follows: * The textures in this list are as follows:
@ -193,7 +193,7 @@ struct S_MaterialProperty
// The vector components are R,G,B // The vector components are R,G,B
osg::Vec3f ambient{1.f,1.f,1.f}, diffuse{1.f,1.f,1.f}; osg::Vec3f ambient{1.f,1.f,1.f}, diffuse{1.f,1.f,1.f};
osg::Vec3f specular, emissive; osg::Vec3f specular, emissive;
float glossiness, alpha; float glossiness{0.f}, alpha{0.f};
void read(NIFStream *nif); void read(NIFStream *nif);
}; };

View File

@ -785,6 +785,7 @@ MWShadowTechnique::MWShadowTechnique():
_debugHud(nullptr) _debugHud(nullptr)
{ {
_shadowRecievingPlaceholderStateSet = new osg::StateSet; _shadowRecievingPlaceholderStateSet = new osg::StateSet;
mSetDummyStateWhenDisabled = false;
} }
MWShadowTechnique::MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::CopyOp& copyop): MWShadowTechnique::MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::CopyOp& copyop):
@ -792,6 +793,7 @@ MWShadowTechnique::MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::C
{ {
_shadowRecievingPlaceholderStateSet = new osg::StateSet; _shadowRecievingPlaceholderStateSet = new osg::StateSet;
_enableShadows = vdsm._enableShadows; _enableShadows = vdsm._enableShadows;
mSetDummyStateWhenDisabled = vdsm.mSetDummyStateWhenDisabled;
} }
MWShadowTechnique::~MWShadowTechnique() MWShadowTechnique::~MWShadowTechnique()

View File

@ -78,7 +78,7 @@ void TerrainDrawable::cull(osgUtil::CullVisitor *cv)
osg::RefMatrix& matrix = *cv->getModelViewMatrix(); osg::RefMatrix& matrix = *cv->getModelViewMatrix();
if (cv->getComputeNearFarMode() && bb.valid()) if (cv->getComputeNearFarMode() != osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR && bb.valid())
{ {
if (!cv->updateCalculatedNearFar(matrix, *this, false)) if (!cv->updateCalculatedNearFar(matrix, *this, false))
return; return;

View File

@ -286,7 +286,7 @@ namespace ICS
//ControlAxisBinderItem joystickBinderItem = mControlsJoystickAxisBinderMap[ evt.which ][ axis ]; // joystic axis start at 0 index //ControlAxisBinderItem joystickBinderItem = mControlsJoystickAxisBinderMap[ evt.which ][ axis ]; // joystic axis start at 0 index
//Control* ctrl = joystickBinderItem.control; //Control* ctrl = joystickBinderItem.control;
//if(ctrl && ctrl->isAxisBindable()) //if(ctrl && ctrl->isAxisBindable())
if(mDetectingBindingControl && mDetectingBindingControl->isAxisBindable()) if(mDetectingBindingControl->isAxisBindable())
{ {
if( abs( evt.value ) > ICS_JOYSTICK_AXIS_BINDING_MARGIN) if( abs( evt.value ) > ICS_JOYSTICK_AXIS_BINDING_MARGIN)
{ {