diff engine/core/view/camera.cpp @ 181:56ac89189bc4

fixed time handling in fife: - the time scaling method was unreliable when changing the time factors (jumping in the moment of the change) - replaced much calls to SDL_GetTicks with TimerManager::instance()->getTime() - some other time related cleanup
author spq@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 31 Jan 2009 04:15:43 +0000
parents 29309cd5e240
children 09f40db3f10c
line wrap: on
line diff
--- a/engine/core/view/camera.cpp	Fri Jan 30 00:58:43 2009 +0000
+++ b/engine/core/view/camera.cpp	Sat Jan 31 04:15:43 2009 +0000
@@ -484,8 +484,6 @@
 		//	return;
 		//}
 		
-		const unsigned long curtime = TimeManager::instance()->getTime();
-		
 		// update each layer
 		m_renderbackend->pushClipArea(getViewPort());
 		
@@ -534,9 +532,8 @@
 				if (action) {
 					FL_DBG(_log, "Instance has action");
 					int animation_id = action->getVisual<ActionVisual>()->getAnimationIndexByAngle(angle);
-
 					Animation& animation = m_apool->getAnimation(animation_id);
-					int animtime = scaleTime(instance->getTotalTimeMultiplier(), instance->getActionRuntime()) % animation.getDuration();
+					unsigned int animtime = instance->getActionRuntime() % animation.getDuration();
 					image = animation.getFrameByTimestamp(animtime);
 				} else {
 					FL_DBG(_log, "No action");
@@ -550,7 +547,7 @@
 						if (action) {
 							int animation_id = action->getVisual<ActionVisual>()->getAnimationIndexByAngle(angle);
 							Animation& animation = m_apool->getAnimation(animation_id);
-							int animtime = scaleTime(instance->getTotalTimeMultiplier(), curtime) % animation.getDuration();
+							unsigned int animtime = instance->getRuntime() % animation.getDuration();
 							image = animation.getFrameByTimestamp(animtime);
 						}
 					}