浏览代码

Bugfix in AddAnimationKey, fix warnings (thanks viciious)

Michael Ragazzon 6 年之前
父节点
当前提交
73de134f71
共有 3 个文件被更改,包括 10 次插入1 次删除
  1. 2 0
      Include/Rocket/Core/Vector2.inl
  2. 6 1
      Source/Core/ElementAnimation.cpp
  3. 2 0
      Source/Core/PropertyParserAnimation.cpp

+ 2 - 0
Include/Rocket/Core/Vector2.inl

@@ -70,6 +70,7 @@ Vector2< Type > Vector2< Type >::Normalise() const
 }
 
 // Generates a rounded vector from this vector.
+template < >
 Vector2< float > Vector2< float >::Round() const
 {
 	Vector2 < float > result;
@@ -79,6 +80,7 @@ Vector2< float > Vector2< float >::Round() const
 }
 
 // Generates a rounded vector from this vector.
+template < >
 Vector2< int > Vector2< int >::Round() const
 {
 	return *this;

+ 6 - 1
Source/Core/ElementAnimation.cpp

@@ -435,9 +435,14 @@ bool ElementAnimation::AddKey(float target_time, const Property & in_property, E
 	}
 
 	if(result)
-		if(extend_duration) duration = target_time;
+	{
+		if(extend_duration) 
+			duration = target_time;
+	}
 	else
+	{
 		keys.pop_back();
+	}
 
 	return result;
 }

+ 2 - 0
Source/Core/PropertyParserAnimation.cpp

@@ -159,6 +159,8 @@ static bool ParseAnimation(Property & property, const StringList& animation_valu
 				case Keyword::PAUSED:
 					animation.paused = true;
 					break;
+				default:
+					break;
 				}
 			}
 			else