瀏覽代碼

Code cleanup

Ivan Savenko 2 年之前
父節點
當前提交
c3a2dee45a
共有 4 個文件被更改,包括 12 次插入3 次删除
  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()
 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;
 	frameTime += GH.mainFPSmng->getElapsedMilliseconds() / 1000.f;
 	size_t newFrame = frame;
 	size_t newFrame = frame;

+ 3 - 1
client/widgets/Images.h

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

+ 7 - 0
lib/CCreatureHandler.h

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

+ 1 - 1
lib/serializer/CSerializer.h

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