animperform branch does not build

Everything about development and the OpenMW source code.
Post Reply
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

animperform branch does not build

Post by Zini »

The jhooks1/animperform branch does not build for me:
In file included from /home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:1:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp: In constructor ‘MWRender::Animation::Animation(MWWorld::Environment&, OEngine::Render::OgreRenderer&)’:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp:40: warning: ‘MWRender::Animation::animate’ will be initialized after
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp:31: warning: ‘float MWRender::Animation::oldHund’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp:64: warning: when initialized here
In file included from /home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/../mwrender/npcanimation.hpp:3,
from /home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/../mwrender/actors.hpp:17,
from /home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/../mwrender/renderingmanager.hpp:25,
from /home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/world.hpp:12,
from /home/marc/OpenMW/openmw/apps/openmw/mwrender/debugging.cpp:12:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/../mwrender/animation.hpp: In constructor ‘MWRender::Animation::Animation(MWWorld::Environment&, OEngine::Render::OgreRenderer&)’:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/../mwrender/animation.hpp:40: warning: ‘MWRender::Animation::animate’ will be initialized after
/home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/../mwrender/animation.hpp:31: warning: ‘float MWRender::Animation::oldHund’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/../mwworld/../mwrender/animation.hpp:64: warning: when initialized here
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp: In member function ‘void MWRender::Animation::handleAnimationTransforms()’:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:430: error: invalid initialization of non-const reference of type ‘std::vector<Ogre::Quaternion, std::allocator<Ogre::Quaternion> >&’ from a temporary of type ‘std::vector<Ogre::Quaternion, std::allocator<Ogre::Quaternion> >’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:432: error: invalid initialization of non-const reference of type ‘std::vector<float, std::allocator<float> >&’ from a temporary of type ‘std::vector<float, std::allocator<float> >’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:435: error: invalid initialization of non-const reference of type ‘std::vector<float, std::allocator<float> >&’ from a temporary of type ‘std::vector<float, std::allocator<float> >’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:442: error: invalid initialization of non-const reference of type ‘std::vector<Ogre::Vector3, std::allocator<Ogre::Vector3> >&’ from a temporary of type ‘std::vector<Ogre::Vector3, std::allocator<Ogre::Vector3> >’
In file included from /home/marc/OpenMW/openmw/apps/openmw/mwrender/npcanimation.hpp:3,
from /home/marc/OpenMW/openmw/apps/openmw/mwrender/actors.hpp:17,
from /home/marc/OpenMW/openmw/apps/openmw/mwrender/renderingmanager.hpp:25,
from /home/marc/OpenMW/openmw/apps/openmw/mwrender/renderingmanager.cpp:1:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp: In constructor ‘MWRender::Animation::Animation(MWWorld::Environment&, OEngine::Render::OgreRenderer&)’:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp:40: warning: ‘MWRender::Animation::animate’ will be initialized after
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp:31: warning: ‘float MWRender::Animation::oldHund’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.hpp:64: warning: when initialized here
make[2]: *** [apps/openmw/CMakeFiles/openmw.dir/mwrender/animation.cpp.o] Error 1
Don't have the time to look into it right now.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: animperform branch does not build

Post by jhooks1 »

Made another commit, let me know if it helps.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: animperform branch does not build

Post by Zini »

Nope:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp: In member function ‘void MWRender::Animation::handleAnimationTransforms()’:
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:430: error: invalid initialization of non-const reference of type ‘std::vector<Ogre::Quaternion, std::allocator<Ogre::Quaternion> >&’ from a temporary of type ‘std::vector<Ogre::Quaternion, std::allocator<Ogre::Quaternion> >’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:432: error: invalid initialization of non-const reference of type ‘std::vector<float, std::allocator<float> >&’ from a temporary of type ‘std::vector<float, std::allocator<float> >’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:435: error: invalid initialization of non-const reference of type ‘std::vector<float, std::allocator<float> >&’ from a temporary of type ‘std::vector<float, std::allocator<float> >’
/home/marc/OpenMW/openmw/apps/openmw/mwrender/animation.cpp:442: error: invalid initialization of non-const reference of type ‘std::vector<Ogre::Vector3, std::allocator<Ogre::Vector3> >&’ from a temporary of type ‘std::vector<Ogre::Vector3, std::allocator<Ogre::Vector3> >’
make[2]: *** [apps/openmw/CMakeFiles/openmw.dir/mwrender/animation.cpp.o] Error 1
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: animperform branch does not build

Post by jhooks1 »

Don't know whats wrong then, builds fine here.

EDIT: Seems to offer a good performance boost, in the Earthly delights test at some points it is up to 50fps
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: animperform branch does not build

Post by Zini »

Okay. I see the problem. You can not assign a temporary object to a non-const reference. It is not legal C++. That MSVC allows it, is apparently a bug/misfeature.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: animperform branch does not build

Post by jhooks1 »

Would adding a const in the problem areas fix the problem? Or should the &'s be removed for these lines?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: animperform branch does not build

Post by Zini »

If you don't need it non-const, yes.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: animperform branch does not build

Post by jhooks1 »

Can you try my latest commit?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: animperform branch does not build

Post by Zini »

Will give it a try tomorrow. To late for me now to do further development work. Half of the brain is already asleep.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: animperform branch does not build

Post by Zini »

Works now. Thanks.
Post Reply