Commit Graph
45 Commits
Author SHA1 Message Date
obligaron 3c571bf64b Avoid overflow of tickCounterOfCurrentFrame (#4893)
* When MFLAG_ALLOW_SPECIAL is set, don't call processAnimation (avoid overflow of tickCounterOfCurrentFrame)
2022-07-05 19:23:32 +02:00
k-bar 26de74f4a2 AnimationInfo class correct style (#4870)
* AnimationInfo class correct case-style for private members

clang-tidy warnings:
readability-identifier-naming    invalid case style for private member

* AnimationInfo class correct case-style for members

clang-tidy warnings:
readability-identifier-naming    invalid case style for member

* AnimationInfo class correct case-style for methods

clang-tidy warnings:
readability-identifier-naming    invalid case style for method

* AnimationInfo class use nodiscard

clang-tidy warnings:
modernize-use-nodiscard    function  should be marked [[nodiscard]]
2022-07-03 16:55:37 +02:00
Gleb Mazovetskiy 21dc7f553d Add OptionalCelSprite: smaller than std::optional
`CelSprite` data pointer can never be `nullptr`.

We implement a smaller `optional` for it by taking advantage of that.
2022-07-03 12:26:39 +01:00
obligaron e87aca38bb Change animation frames and tick per frame to int8_t 2022-07-03 10:20:42 +01:00
Gleb Mazovetskiy a66ca44695 Zero-based frame indexing
Index frames starting at 0 instead of 1.
2022-04-14 04:39:26 +01:00
Gleb Mazovetskiy 7fede6c4cb Clean up owned/unowned CelSprite ambiguity
Makes `CelSprite` unowned and adds a new `OwnedCelSprite` class for
owned sprites.

This clarifies ownership and makes the code cleaner in a number of
places.

Additionally, because the `CelSprite` class is now tiny (1 less
pointer), we can pass it by-value instead of by-reference, removing a
pointer indirection in the rendering functions.
2022-03-06 04:49:13 +01:00
obligaron 2843d99485 Fix walk stuttering with Preview Frame 2022-01-15 14:40:35 +01:00
obligaron 75760382ef Regard preview frame in AnimationInfo 2022-01-12 12:26:39 +01:00
obligaron a7f361de41 AnimationInfo: Change TicksSinceSequenceStarted and relevantAnimationTicksWithSkipping to float 2022-01-12 12:26:39 +01:00
Andrew James 949206424e Enable clang-tidy in Visual Studio projects (#3101) 2021-10-12 00:32:57 +00:00
ephphatha b15e08fc3f Deduplicate logic in GetAnimationProgress 2021-10-11 18:59:02 +02:00
obligaron e67ea3639f Fix AnimationInfo::GetAnimationProgress() when normal animation logic is used (for example loaded save games) 2021-09-16 19:22:24 +02:00
ephphatha 67ecea1a42 Always set the monster animation when ChangeAnimationData is called
Required updating AnimationInfo to handle being passed 0 for the total framecount, previously it would call clamp with min > max which was invalid.
2021-09-12 02:27:47 +02:00
ephphatha 8e155e011f Rename helpers on Monster to match AnimationInfo 2021-09-12 02:27:47 +02:00
Anders Jenbo d523fc1e81 Cleanups 2021-08-02 10:12:40 +02:00
obligaron 551645060b Fix item swapping and AnimationInfo::ChangeAnimationData 2021-07-26 22:46:16 +02:00
obligaron 54d63e2edd Change AnimationInfo.pCelSprite to const 2021-07-12 07:40:38 -07:00
Anders Jenbo 2ca6e37c46 Clean up sub folders using clang-tidy/Android Studio 2021-07-08 03:30:25 -07:00
ephphatha 3520dc4201 Update numeric literals to use appropriate suffix
Mainly things like .F for floats instead of doubles in float context.
2021-07-05 08:52:05 -07:00
obligaron 3a9cc631c7 Rename DelayLen -> TicksPerFrame
Rename DelayCounter -> TickCounterOfCurrentFrame
2021-06-27 01:26:49 -07:00
obligaron 3ba4bac5e2 Harmonize DelayLen for Player and Monster (was 1-based on monseter (>= DelayLen) and 0-based on player (> DelayLen). Now both are 1-based (>= DelayLen) 2021-06-27 01:26:49 -07:00
Anders Jenbo fa54499aeb Clang-tidy: readability-uppercase-literal-suffix
Strip suffixes
2021-06-27 03:17:36 +02:00
Anders Jenbo ec8d7bebe2 Clang-tidy: modernize-use-auto 2021-06-27 01:18:31 +02:00
obligaron d4bda3c13e ADL: correct comment typo 2021-06-26 13:30:36 -07:00
obligaron 801207a8ac ADL: Handle incorrect TicksSinceSequenceStarted better 2021-06-26 13:30:36 -07:00
obligaron fb23521288 Introduce AnimationInfo.IsPetrified to handle Stone Curse Spell 2021-06-25 11:52:12 -07:00
obligaron a4cacfbcbe Enable ADL for Monsters 2021-06-25 11:52:12 -07:00
Anders Jenbo af254601d6 ♻️ Apply clang-tidy to engine 2021-06-25 13:22:08 +02:00
qndel 6931c438d3 fix typo (#2150) 2021-06-13 20:15:23 +02:00
obligaron 61ba5009ac Convert to CelSprite 2021-05-24 20:12:43 +02:00
qndel 69b903743a fix typos 2021-05-23 05:52:52 +02:00
obligaron a295586636 Support changing animation data on-the-fly even if the number of frames differ 2021-05-19 21:16:19 +02:00
obligaron 19615c6976 AnimationInfo: Add GetAnimationProgress() 2021-05-16 21:24:36 +02:00
obligaron b94e599f5e ADL: Advance skipped Frames in SetNewAnimation and remove logic from PM_XYZ 2021-05-09 09:53:53 +02:00
Anders Jenbo c11945e62b 🎨 Fix line endings 2021-05-07 23:22:51 +02:00
Anders Jenbo f579b2f287 Handle cel/cl2 files as byte arrays 2021-05-06 13:17:54 +02:00
obligaron cb7819a75c Introduce AnimationDistributionFlags::RepeatedAction 2021-05-06 07:52:17 +02:00
obligaron b5954eb34b Change AnimationDistributionParams to AnimationDistributionFlags 2021-05-06 07:52:17 +02:00
obligaron b08e0c20dc In repeated Animations show skipped Frames from previous Animation (repeated Attack/RangeAttack/Spell) 2021-05-06 07:52:17 +02:00
obligaron 401a820998 Rename GameTick to Tick (for variables) 2021-04-29 04:33:51 +02:00
obligaron 26601c98dc Simplify GetFrameToUseForRendering (remove local variables and use member variables) 2021-04-29 04:33:51 +02:00
obligaron ff995adc2b Move ProcessPlayerAnimation to AnimationInfo 2021-04-29 04:33:51 +02:00
obligaron 16b3b38908 Move NewPlrAnim logic to AnimationInfo
Adjust SetNewAnimation-Parameter Names to Class Member

Adjust NewPlrAnim-Parameter Names to SetNewAnimation-Parameter Names
2021-04-29 04:33:51 +02:00
obligaron 3b87433fc2 Move GetFrameToUseForPlayerRendering to AnimationInfo 2021-04-29 04:33:51 +02:00
obligaron 0b5183f63e Introduce AnimationInfo
Update AnimationInfo.DelayLen comment
2021-04-29 04:33:51 +02:00