diff engine/core/view/camera.cpp @ 245:ed1565a5a2a0

Fixed second camera in rio. Now multiple Camera.setLocation calls per frame are handled correctly.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 25 Mar 2009 14:17:59 +0000
parents 09f40db3f10c
children 493f7492f0ba
line wrap: on
line diff
--- a/engine/core/view/camera.cpp	Wed Mar 25 09:38:10 2009 +0000
+++ b/engine/core/view/camera.cpp	Wed Mar 25 14:17:59 2009 +0000
@@ -145,7 +145,7 @@
 		if ((m_prev_origo == m_cur_origo) && (m_prev_origo == ScreenPoint(0,0,0))) {
 			m_cur_origo = toScreenCoordinates(ExactModelCoordinate(0,0,0));
 			m_prev_origo = m_cur_origo;
-		}	
+		}
 		m_location = location;
 		
 		CellGrid* cg = NULL;
@@ -160,7 +160,6 @@
 		
 		updateMatrices();
 		
-		m_prev_origo = m_cur_origo;
 		m_cur_origo = toScreenCoordinates(ExactModelCoordinate(0,0,0));
 	}
 
@@ -473,7 +472,7 @@
 	}
 
 	void Camera::render() {
-		ScreenPoint cammove = getLatestMovement();
+		ScreenPoint cammove = m_prev_origo - m_cur_origo;
 		
 		Map* map = m_location.getMap();
 		if (!map) {