1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00

Don't rely on virtual dispatch in constructor

apps/openmw/mwrender/animation.cpp:1841:60: warning: Call to virtual method 'ObjectAnimation::canBeHarvested' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
        if (ptr.getRefData().getCustomData() != nullptr && canBeHarvested())
                                                           ^~~~~~~~~~~~~~~~

apps/openmw/mwrender/bulletdebugdraw.cpp:33:5: warning: Call to virtual method 'DebugDrawer::setDebugMode' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
    setDebugMode(debugMode);
    ^~~~~~~~~~~~~~~~~~~~~~~

openmw/mwinput/controllermanager.cpp:63:17: warning: Call to virtual method 'ControllerManager::controllerAdded' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
                controllerAdded(fakeDeviceID, evt);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
elsid 2022-07-06 13:09:19 +02:00
parent 4ecee2e167
commit bd7f56ddb4
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625
3 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ namespace MWInput
SDL_ControllerDeviceEvent evt;
evt.which = i;
static const int fakeDeviceID = 1;
controllerAdded(fakeDeviceID, evt);
ControllerManager::controllerAdded(fakeDeviceID, evt);
Log(Debug::Info) << "Detected game controller: " << SDL_GameControllerNameForIndex(i);
}
else

View File

@ -1838,7 +1838,7 @@ namespace MWRender
mObjectRoot->accept(visitor);
}
if (ptr.getRefData().getCustomData() != nullptr && canBeHarvested())
if (ptr.getRefData().getCustomData() != nullptr && ObjectAnimation::canBeHarvested())
{
const MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr);
if (!store.hasVisibleItems())

View File

@ -30,7 +30,7 @@ DebugDrawer::DebugDrawer(osg::ref_ptr<osg::Group> parentNode, btCollisionWorld *
: mParentNode(parentNode),
mWorld(world)
{
setDebugMode(debugMode);
DebugDrawer::setDebugMode(debugMode);
}
void DebugDrawer::createGeometry()