summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-23 05:06:17 +0200
committerTreeki <treeki@gmail.com>2012-09-23 05:06:17 +0200
commitea8aca1a99032a4d5326a62bf5e7e5ed946f2f2a (patch)
tree8bb7b67923160be6c16d5ce9f7a7a4ec35a52b97 /src/koopatlas/pathmanager.cpp
parent41824ae3312c3413d3ef00354aeb5a956f160c89 (diff)
downloadkamek-ea8aca1a99032a4d5326a62bf5e7e5ed946f2f2a.tar.gz
kamek-ea8aca1a99032a4d5326a62bf5e7e5ed946f2f2a.zip
finally fixed all animations... I hope?
Diffstat (limited to '')
-rw-r--r--src/koopatlas/pathmanager.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index fc17383..38d18d1 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -442,7 +442,7 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
// TJumped
{Tjumped,2.0f,0.0f, -1,-1.0f, SE_NULL,SE_NULL, 0,0},
- // Enter/leave cave, these are handled specially
+ // Enter cave, this is handled specially
{run,1.0f,10.0f, -1,1.0f, SE_NULL,SE_NULL, 0,0},
{run,1.0f,10.0f, -1,1.0f, SE_NULL,SE_NULL, 0,0},
@@ -452,9 +452,12 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
isJumping = (path->animation >= dKPPath_s::JUMP && path->animation <= dKPPath_s::JUMP_WATER);
- if (path->animation == dKPPath_s::ENTER_CAVE || path->animation == dKPPath_s::LEAVE_CAVE) {
+ if (path->animation == dKPPath_s::ENTER_CAVE) {
scaleAnimProgress = 60;
- if (path->animation == dKPPath_s::LEAVE_CAVE)
+ // what direction does this path go in?
+ isScalingUp = (deltaY < 0) ^ reverseThroughPath;
+
+ if (!isScalingUp)
player->scale = (Vec){0.0f,0.0f,0.0f};
}
@@ -464,7 +467,7 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
player->startAnimation(Animations[id].anim, Animations[id].animParam1, Animations[id].animParam2, 0.0f);
- player->rot.y = (Animations[id].forceRotation >= 0) ? Animations[id].forceRotation : direction;
+ player->rot.y = (Animations[id].forceRotation != -1) ? Animations[id].forceRotation : direction;
moveSpeed = (Animations[id].forceSpeed >= 0.0f) ? Animations[id].forceSpeed : 3.0f;
if (Animations[id].repeatEffect) {
@@ -498,7 +501,7 @@ void dWMPathManager_c::moveThroughPath() {
if (scaleAnimProgress >= 0) {
float soFar = scaleAnimProgress * (1.6f / 60.0f);
- float sc = (currentPath->animation == dKPPath_s::ENTER_CAVE) ? (1.6f - soFar) : soFar;
+ float sc = isScalingUp ? soFar : (1.6f - soFar);
player->scale.x = player->scale.y = player->scale.z = sc;
scaleAnimProgress--;