Browse Source

Code cleanup

Ivan Savenko 2 years ago
parent
commit
c3a2dee45a
4 changed files with 12 additions and 3 deletions
  1. 1 1
      client/gui/CursorHandler.cpp
  2. 3 1
      client/widgets/Images.h
  3. 7 0
      lib/CCreatureHandler.h
  4. 1 1
      lib/serializer/CSerializer.h

+ 1 - 1
client/gui/CursorHandler.cpp

@@ -260,7 +260,7 @@ void CursorHandler::centerCursor()
 
 void CursorHandler::updateSpellcastCursor()
 {
-	static const float frameDisplayDuration = 5.f / 60.f; // H3 uses ~83 ms per image = 5 / 60 second
+	static const float frameDisplayDuration = 0.1f; // H3 uses 100 ms per frame
 
 	frameTime += GH.mainFPSmng->getElapsedMilliseconds() / 1000.f;
 	size_t newFrame = frame;

+ 3 - 1
client/widgets/Images.h

@@ -125,8 +125,10 @@ protected:
 
 	size_t first, last; //animation range
 
-	/// how long (in milliseconds) should
+	/// total time on scren for each frame in animation
 	ui32 frameTimeTotal;
+
+	/// how long was current frame visible on screen
 	ui32 frameTimePassed;
 
 	ui8 flags;//Flags from EFlags enum

+ 7 - 0
lib/CCreatureHandler.h

@@ -90,6 +90,13 @@ public:
 			h & idleAnimationTime;
 			h & walkAnimationTime;
 			h & attackAnimationTime;
+
+			if (version < 814)
+			{
+				float unused = 0.f;
+				h & unused;
+			}
+
 			h & upperRightMissleOffsetX;
 			h & rightMissleOffsetX;
 			h & lowerRightMissleOffsetX;

+ 1 - 1
lib/serializer/CSerializer.h

@@ -14,7 +14,7 @@
 
 VCMI_LIB_NAMESPACE_BEGIN
 
-const ui32 SERIALIZATION_VERSION = 813;
+const ui32 SERIALIZATION_VERSION = 814;
 const ui32 MINIMAL_SERIALIZATION_VERSION = 813;
 const std::string SAVEGAME_MAGIC = "VCMISVG";