diff options
-rw-r--r-- | src/koopatlas/mapdata.h | 2 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 13 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.h | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/koopatlas/mapdata.h b/src/koopatlas/mapdata.h index a0df0dc..bc0c599 100644 --- a/src/koopatlas/mapdata.h +++ b/src/koopatlas/mapdata.h @@ -117,7 +117,7 @@ struct dKPPath_s { JUMP = 4, JUMP_SAND = 5, JUMP_SNOW = 6, JUMP_WATER = 7, LADDER = 8, LADDER_LEFT = 9, LADDER_RIGHT = 10, FALL = 11, SWIM = 12, RUN = 13, PIPE = 14, DOOR = 15, - TJUMPED = 16, ENTER_CAVE = 17, LEAVE_CAVE = 18, INVISIBLE = 19, + TJUMPED = 16, ENTER_CAVE_UP = 17, RESERVED_18 = 18, INVISIBLE = 19, MAX_ANIM = 20 }; 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--; diff --git a/src/koopatlas/pathmanager.h b/src/koopatlas/pathmanager.h index 9be8e86..3c3ae1f 100644 --- a/src/koopatlas/pathmanager.h +++ b/src/koopatlas/pathmanager.h @@ -36,6 +36,7 @@ class dWMPathManager_c { float moveSpeed; int scaleAnimProgress; + bool isScalingUp; dKPPath_s *currentPath; bool reverseThroughPath; // direction we are going through the path |