comparison engine/core/view/camera.cpp @ 399:d98e398d3057

This change ensures that the instances rotation is always in sync with its facing location.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 28 Jan 2010 03:26:29 +0000
parents 493f7492f0ba
children cfe2f6db4964
comparison
equal deleted inserted replaced
398:7b1de5e31834 399:d98e398d3057
522 //drawpt.z = toScreenCoordinates( instance->getLocationRef().getMapCoordinates() ).z; 522 //drawpt.z = toScreenCoordinates( instance->getLocationRef().getMapCoordinates() ).z;
523 } else { 523 } else {
524 drawpt = toScreenCoordinates( instance->getLocationRef().getMapCoordinates() ); 524 drawpt = toScreenCoordinates( instance->getLocationRef().getMapCoordinates() );
525 vc.facing_angle = angle = getAngleBetween(instance->getLocationRef(), instance->getFacingLocation()); 525 vc.facing_angle = angle = getAngleBetween(instance->getLocationRef(), instance->getFacingLocation());
526 } 526 }
527 angle += instance->getRotation(); 527
528 //This is to fix ticket #361. I would rather not have to put this here.
529 //It should be handled in a more appropriate spot like within Instance::setFacingLocation().
530 //It ensures the instances rotation is in sync with it's facing direction.
531 if (angle < 0) {
532 angle = 360+angle;
533 }
534 instance->setRotation(angle);
528 535
529 Image* image = NULL; 536 Image* image = NULL;
530 Action* action = instance->getCurrentAction(); 537 Action* action = instance->getCurrentAction();
531 if (action) { 538 if (action) {
532 FL_DBG(_log, "Instance has action"); 539 FL_DBG(_log, "Instance has action");