enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows
http://www.limonengine.com
GNU Lesser General Public License v3.0
580 stars 57 forks source link

Fix uninitialised variables in `ModelAsset` class #76

Closed jmcph4 closed 5 years ago

jmcph4 commented 5 years ago

This commit provides a definition for animationNewTime in src/Assets/ModelAsset.cpp, fixing a compiler warning complaining of uninitialised values.

See #75

enginmanap commented 5 years ago

Hi,

I think this warning should never been thrown, and it needs a deeper look. Let me check it again.

jmcph4 commented 5 years ago

@enginmanap that's fine, feel free to knock this one back. I try and keep changes small for that reason.

enginmanap commented 5 years ago

Hi,

I am working on another feature that became a blocker for 0.6 release, didn't have time sorry. I will look into this as soon as possible.

enginmanap commented 5 years ago

He @jmcph4, bd63a7 doesn't have that warning anymore. Can you please check?

jmcph4 commented 5 years ago

@enginmanap Same build output as of eb3bd38:

[ 29%] Building CXX object CMakeFiles/LimonEngine.dir/src/Assets/ModelAsset.cpp.o
/home/jmcph4/dev/tmp/_limonEngine2/src/Assets/ModelAsset.cpp: In member function ‘bool ModelAsset::getTransformBlended(std::__cxx11::string, long int, bool, std::__cxx11::string, long int, bool, float, std::vector<glm::tmat4x4<float, (glm::precision)0u> >&) const’:
/home/jmcph4/dev/tmp/_limonEngine2/src/Assets/ModelAsset.cpp:511:108: warning: ‘animationTimeNew’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                                        currentAnimationNew, animationTimeNew, blendFactor, transformMatrix);
                                                                                                            ^
/home/jmcph4/dev/tmp/_limonEngine2/src/Assets/ModelAsset.cpp:511:108: warning: ‘animationTimeOld’ may be used uninitialized in this function [-Wmaybe-uninitialized]