Commit Graph
668 Commits
Author SHA1 Message Date
Anders Jenbo de4ced7e4f Clang-tidy: readability-qualified-auto 2021-06-27 00:56:08 +02:00
Anders Jenbo f4f8f22699 Clang-tidy: readability-redundant-control-flow 2021-06-27 00:56:08 +02:00
Anders Jenbo bf221f4322 Clang-tidy: readability-simplify-boolean-expr 2021-06-26 23:12:22 +02:00
Anders Jenbo 2bdb6caa07 Cleanup majority of remaning implicit bool conversions (#2234) 2021-06-26 21:05:45 +02:00
ephphatha f4f6a8a51e Refactor PlaySfxLoc to take a Point instead of x/y params
Because of the heavy usage of this function in objects.cpp and the mixed use of aliases and direct references to the active object in Operate*Door functions I've done some refactoring of those areas beyond what is strictly necessary. Hopefully this makes sense and is reasonable to include in this change.
2021-06-26 10:12:28 -07:00
Anders Jenbo d8fa29c972 Clean up more implicit bool conversion 2021-06-26 10:07:02 -07:00
Anders Jenbo 22b632f04a ♻️Clean up implicit bool conversions 2021-06-26 08:57:59 -07:00
Anders Jenbo 1cc0eb25ca ♻️Use ranges for loops (clang-tidy) 2021-06-25 13:22:08 +02:00
Anders Jenbo 625333dfb1 ♻️Clean up items 2021-06-24 10:45:50 -07:00
Andrew James 60a47caf1b Refactor Draw* functions to use Rectangle and Point types
Added overload for DrawString taking a Point to avoid creating a rect for callers which only use position. This also documents the way DrawString operates when passed a clipping rectangle with a dimension of 0.
As part of this overload removed the logic for 0 width regions from DrawString. This does change the behaviour of the Rectangle version if called with a rect with width 0, all callers using that behaviour have been updated in this commit.

Using Rectangle/Size allowed simplifying the logic for certain calls where they could use DrawText alignment flags, previously this was manually aligning by calculating dimensions and offsetting the position. This also fixes #2169

Also includes a few instances where a temporary buffer was used to set the text to be drawn with unbounded sprintf calls, replaced those with snprintf as is recommended in modern C applications. Moving to C++ strings would be good in a future refactor.
2021-06-24 01:36:06 +02:00
Anders Jenbo ee7b32d8f6 Player by reference part 3 2021-06-24 00:53:09 +02:00
qndel 92d1006134 Use std::move for premiumitems shift 2021-06-23 12:46:03 -07:00
Juliano Leal Goncalves 604b72bb12 Reword potion effect descriptions for consistency 2021-06-22 13:09:05 -07:00
Gleb Mazovetskiy e40b1963f9 🚚 engine.h: Extract CelSprite and file loading 2021-06-21 01:36:20 -07:00
Gleb Mazovetskiy dcf3397139 🚚 engine.h: Extract ActorPosition 2021-06-21 01:36:20 -07:00
Juliano Leal Goncalves d47fc924f3 ♻️ Use '_item_indexes' instead of 'int' for 'ItemStruct.IDidx' field 2021-06-14 02:07:06 +02:00
obligaron ab3f3f3ee7 Introduce ItemStruct.SetNewAnimation(bool) to start Animations only at one location 2021-06-08 10:12:09 +02:00
obligaron 6d5291b17d Enable ADL for Items 2021-06-08 10:12:09 +02:00
obligaron ccc1ccf9c3 Introduce ItemStruct.AnimInfo 2021-06-08 10:12:09 +02:00
Anders Jenbo 27591cc29f Fix spawn save game compatability 2021-06-06 04:51:43 +02:00
Juliano Leal Goncalves e67683e5be ♻️ Simplify 'GetSuperItemLoc' logic using 'Point'. 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves b0584f1925 ♻️ Simplify 'GetSuperItemSpace' logic using 'Point'. 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves 1cc121e95c ♻️ Simplify 'SpawnRock' logic using 'Point'. 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves 1bf319bc11 ♻️ Leverage 'Point' struct on 'ItemPlace' 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves 6aa6efb720 ♻️ Extract item position generation logic to common function 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves b04047ba4d ♻️ Leverage 'Point' struct on 'SpawnUnique' 2021-05-31 06:05:35 +02:00
Juliano Leal Goncalves 9c85e61025 ♻️ Leverage 'Point' struct on 'ItemSpaceOk' 2021-05-31 06:05:35 +02:00
qndel ab0478319c assign seed to quest items + rng cleanup 2021-05-28 20:02:58 +02:00
Kalebe Alves 118efe8e6d Use Point/SDL_Rect for control functions coordinate system 2021-05-28 19:57:16 +02:00
Gleb Mazovetskiy dd3ea66fa2 ♻️ Split getTextColor(bool) into 2 functions
This is a bit more readable than using a bool argument.
2021-05-28 13:38:36 +02:00
qndel 2f3cf65b27 cleanup getTextColor 2021-05-26 15:58:14 +02:00
qndel b1d74d2791 alt highlighting (#2060) 2021-05-25 23:47:29 +02:00
Anders Jenbo 68249d07e3 Correct false positives translation warnings
Fixes #2053
2021-05-25 01:29:05 +02:00
Anders Jenbo 8a7ec56d3a Player by reference part 2
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
2021-05-24 21:00:32 +02:00
obligaron d97131349e Unify player_graphic memory handling 2021-05-24 20:12:43 +02:00
obligaron 61ba5009ac Convert to CelSprite 2021-05-24 20:12:43 +02:00
obligaron 3067aeacb8 Remove PlayerStruct._pXYZWidth and replace it with calls to GetAnimationWidth 2021-05-24 20:12:43 +02:00
obligaron c424f601ec Change LoadPlrGFX from pnum to PlayerStruct 2021-05-24 20:12:43 +02:00
Jmgr 0e7ada15fc Apply new format to ngexttext translations 2021-05-21 01:02:45 +02:00
Jmgr bbd39aa513 Replace sprintfs with strcpy for translatable strings 2021-05-21 01:02:45 +02:00
Jmgr 6e85cde978 Update format strings 2021-05-21 01:02:45 +02:00
Jmgr 0c27e756f7 Add fmt::format 2021-05-21 01:02:45 +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
Vladimir Olteanu 0c7c71d579 Cleanup of items.cpp (#1967)
- Apply Point where applicable
- Deduplicate vendor logic
- Add comment about unhanded edge case in GetSuperItemLoc
- Initialize some variables at deceleration
2021-05-17 00:12:53 +02:00
obligaron 55fa72d138 When changing items hot-swap the hero animation data and don't start a new animation 2021-05-16 21:25:14 +02:00
arcas 6502a3ca4d Adding resources for translation (#1973) 2021-05-15 14:12:28 +02:00
obligaron 1385e47518 Fix UnitTests in DEBUG (Accessed not initialized ItemAnimations) 2021-05-15 02:08:26 +02:00
Anders Jenbo 6c8b116f6c 🐛 Evaluate item names the same as the original 2021-05-13 22:09:27 +02:00
Anders Jenbo 0c2042fa52 ♻️ Player by reference
Update Source/items.cpp
Update Source/lighting.cpp
Update Source/pack.cpp
asd


ads


as
2021-05-13 01:47:46 +02:00
Anders Jenbo 68e73c0dfe 🐛 Fix infopanel text color 2021-05-12 11:40:31 +02:00