Juliano Leal Goncalves
7da37da8c9
♻️ Leverage 'Point' in 'RenderTile' function
5 years ago
Juliano Leal Goncalves
bb2dfdfb73
🚚 Rename 'ItemStruct' to 'Item'
5 years ago
Juliano Leal Goncalves
f90d3239e5
✨ Add 'Center()' method on 'Rectangle'
5 years ago
Juliano Leal Goncalves
222817af23
✨ Add divide by int operator to 'Size' struct
...
To be used in several places for finding the "center" of rectangles, for example
5 years ago
obligaron
02900c8fa5
Demo: Fix rendering jittering
5 years ago
obligaron
2a6e5712de
Disable hardware cursor for demo playback
5 years ago
Anders Jenbo
df636c0afc
Remove DIR_OMNI
5 years ago
Vladimir Olteanu
090a04670c
Make OwnedSurface::OwnedSurface(Size) explicit
5 years ago
Vladimir Olteanu
bfcc57783c
Remove Surface::{Alloc,Free}, introduce OwnedSurface
5 years ago
obligaron
26e61b363b
demo: Centralize options override
5 years ago
obligaron
77f9bded9e
Introduce demo namespace
5 years ago
Vladimir Olteanu
b17ff04ee2
Use string_view in DrawString and friends
5 years ago
Anders Jenbo
d523fc1e81
Cleanups
5 years ago
ephphatha
0575716eac
Rename UiFlags members to group related options
5 years ago
ephphatha
4ad53232a0
Convert the UiFlags enum to a scoped enum type
...
Replace operator&& with named function
5 years ago
Anders Jenbo
24d0d37d26
Add drop shadow to DrawMapLineSteep
5 years ago
obligaron
551645060b
Fix item swapping and AnimationInfo::ChangeAnimationData
5 years ago
obligaron
1956c6a1c2
Fix some 64bit warnings
5 years ago
ephphatha
f01d551eb0
Add tests for path_get_h_cost, IsTileWalkable, IsTile(Not)Solid, path_solid_pieces, FindPath
...
Only path_solid_pieces and FindPath are used outside the file, but the other functions are exposed in the header and have behaviour I felt worth testing individually.
5 years ago
obligaron
54d63e2edd
Change AnimationInfo.pCelSprite to const
5 years ago
ephphatha
e25d287ba9
Move SetObjMapRange to a member function
...
Due to the way this function is used it was easiest to also change ObjIndex to return a reference to the object instead of the index. Also added an explicit conversion from Size to Displacement to make one of the uses slightly cleaner to express.
5 years ago
ephphatha
b680e3fef1
Align end comment markers for doxygen comments
...
Including a bunch from previous PRs (since I was responsible for the broken formatting for most 😓 )
5 years ago
Anders Jenbo
2ca6e37c46
Clean up sub folders using clang-tidy/Android Studio
5 years ago
Anders Jenbo
dce78dde62
Rename lighting globals
5 years ago
ephphatha
3520dc4201
Update numeric literals to use appropriate suffix
...
Mainly things like .F for floats instead of doubles in float context.
5 years ago
Gleb Mazovetskiy
55464eec78
Fix `-Wmissing-braces`
...
Fixes warnings such as this one:
```
../../../../../../Source/engine/render/text_render.hpp:83:33: warning: suggest braces around initialization of subobject [-Wmissing-braces]
return DrawString(out, text, { position.x, position.y, out.w() - position.x, 0 }, flags, spacing, lineHeight, drawTextCursor);
^~~~~~~~~~~~~~~~~~~~~~
```
5 years ago
Anders Jenbo
a7c7fa0030
Fully apply clang-tidy/format to all files
5 years ago
Gleb Mazovetskiy
cb0dae8590
🚚 Rename `CelOutputBuf` to `Surface` and extract
5 years ago
Gleb Mazovetskiy
3faeb5628a
Fix `Rectangle::Contains` bounds check
5 years ago
ephphatha
6008ea91c1
Address C4244 warnings in MSVC
...
Making Displacement and Point operator*(float) use explicit casts because rounding is desirable.
5 years ago
qndel
a1710ff51e
pass item to CelDrawItem ( #2265 )
...
pass item to CelDrawItem
5 years ago
Juliano Leal Goncalves
cbb84199c2
♻️ Replace Point addition with 'Point + Displacement'
5 years ago
Juliano Leal Goncalves
0441ffc2f4
♻️ Move 'fromDirection' from 'Point' type to 'Displacement' type
5 years ago
Juliano Leal Goncalves
7f89420559
✨ Add 'Displacement' type to represent coordinate deltas
5 years ago
Anders Jenbo
0f2ad469ea
♻️ Clean up variable initialization
5 years ago
Anders Jenbo
8e07ef8fe5
Clang-tidy: misc-unused-parameters
5 years ago
Juliano Leal Goncalves
d93e1fdf07
✨ Add 'Contains' function for 'Rectangle'
...
This will be useful for various bound checks throughout the code.
5 years ago
ephphatha
921c7af8c6
Expand comments for vanilla RNG functions
...
And put them in the header 😂
5 years ago
ephphatha
357f6f1dc3
Move RNG functions to their own header/source files
5 years ago
obligaron
3a9cc631c7
Rename DelayLen -> TicksPerFrame
...
Rename DelayCounter -> TickCounterOfCurrentFrame
5 years ago
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)
5 years ago
Anders Jenbo
fa54499aeb
Clang-tidy: readability-uppercase-literal-suffix
...
Strip suffixes
5 years ago
Anders Jenbo
ec8d7bebe2
Clang-tidy: modernize-use-auto
5 years ago
obligaron
d4bda3c13e
ADL: correct comment typo
5 years ago
obligaron
801207a8ac
ADL: Handle incorrect TicksSinceSequenceStarted better
5 years ago
Anders Jenbo
2bdb6caa07
Cleanup majority of remaning implicit bool conversions ( #2234 )
5 years ago
Andrew James
ff145b422d
Refactor plrctrls functions to use Point and Direction types ( #2155 )
...
* Refactor GetRotaryDistance to use Point instead of int x/y params
* Refactor HSExists to use Point instead of int x/y params
* Refactor IsPathBlocked to take typed params (Point, Direction)
The caller was already passing in a Direction value so this matches usage better. I also pulled the Direction to Point helper function up so it is available as a static class member, this allows replacing the use of the Offset array in plrctrls.cpp.
When adding a Direction to a point (and not scaling it first) I avoid explicitly creating a Point object since the operator+ overload will do that conversion implicitly.
* Replace Offsets array with Point::fromDirection
* Refactor GetDistanceRanged to use Point
I've added ExactDistance as a member function of Point to match ApproxDistance instead of only having it defined in GetDistanceRanged, it seemed more appropriate to be part of the class. Also removed temporary variables from callers of GetDistanceRanged as they were mainly used as a convenience for avoiding repetition when passing values into this function.
* Refactor GetDistance to use Point
5 years ago
obligaron
fb23521288
Introduce AnimationInfo.IsPetrified to handle Stone Curse Spell
5 years ago
obligaron
a4cacfbcbe
Enable ADL for Monsters
5 years ago
Anders Jenbo
2417d3d333
🔥 Remove unused code
5 years ago