Skip to content

Commit

Permalink
matrix: fix interpolation anomaly
Browse files Browse the repository at this point in the history
Resolves #901.
  • Loading branch information
lahm86 authored and rr- committed Aug 15, 2023
1 parent 7425f4c commit f6c8af4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## [Unreleased](https://github.com/rr-/Tomb1Main/compare/stable...develop) - ××××-××-××
- fixed Lara stuttering when performing certain animations (#901, regression from 2.14)

## [2.15.2](https://github.com/rr-/Tomb1Main/compare/2.15.1...2.15.2) - 2023-07-17
- fixed Natla not leaving her semi-death state after Lara takes her down for the first time (#892, regression from 2.15.1)
Expand Down
15 changes: 1 addition & 14 deletions src/math/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void Matrix_Interpolate(void)
MATRIX *mptr = g_MatrixPtr;
MATRIX *iptr = m_IMMatrixPtr;

if (m_IMRate == 2 || (m_IMFrac == 2 && m_IMRate == 4)) {
if (m_IMRate == 2) {
mptr->_00 += (iptr->_00 - mptr->_00) >> 1;
mptr->_01 += (iptr->_01 - mptr->_01) >> 1;
mptr->_02 += (iptr->_02 - mptr->_02) >> 1;
Expand All @@ -351,19 +351,6 @@ void Matrix_Interpolate(void)
mptr->_21 += (iptr->_21 - mptr->_21) >> 1;
mptr->_22 += (iptr->_22 - mptr->_22) >> 1;
mptr->_23 += (iptr->_23 - mptr->_23) >> 1;
} else if (m_IMFrac == 1) {
mptr->_00 += (iptr->_00 - mptr->_00) >> 2;
mptr->_01 += (iptr->_01 - mptr->_01) >> 2;
mptr->_02 += (iptr->_02 - mptr->_02) >> 2;
mptr->_03 += (iptr->_03 - mptr->_03) >> 2;
mptr->_10 += (iptr->_10 - mptr->_10) >> 2;
mptr->_11 += (iptr->_11 - mptr->_11) >> 2;
mptr->_12 += (iptr->_12 - mptr->_12) >> 2;
mptr->_13 += (iptr->_13 - mptr->_13) >> 2;
mptr->_20 += (iptr->_20 - mptr->_20) >> 2;
mptr->_21 += (iptr->_21 - mptr->_21) >> 2;
mptr->_22 += (iptr->_22 - mptr->_22) >> 2;
mptr->_23 += (iptr->_23 - mptr->_23) >> 2;
} else {
mptr->_00 += ((iptr->_00 - mptr->_00) * m_IMFrac) / m_IMRate;
mptr->_01 += ((iptr->_01 - mptr->_01) * m_IMFrac) / m_IMRate;
Expand Down

0 comments on commit f6c8af4

Please sign in to comment.