Anders Jenbo
7771a08d03
Translatable mainpanel
5 years ago
Gleb Mazovetskiy
4e1ad7ab65
LoadFile: Avoid opening the file twice
...
Previously we were passing the path to `GetFileSize`, which resulted in
opening and closing the file twice.
5 years ago
staphen
fb4f1ed8fd
Add structs for virtual gamepad
5 years ago
obligaron
e67ea3639f
Fix AnimationInfo::GetAnimationProgress() when normal animation logic is used (for example loaded save games)
5 years ago
staphen
09b8afba4e
Fix OOB error in DrawString
5 years ago
qndel
1f61b683a6
fix chat line wrapping
5 years ago
Juliano Leal Goncalves
5607c58daa
🏷️ Add 'PickRandomlyAmong' function that picks one value from a set of values randomly
...
This will be used in a few places where we previously used a raw integer random to index into a local array for selection, simplifying that type of logic to a single statement.
5 years ago
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.
5 years ago
ephphatha
8e155e011f
Rename helpers on Monster to match AnimationInfo
5 years ago
ephphatha
b12de6fe12
Use scoped enum for Direction
...
Identified and removed an instance of Direction being used as an argument for a bool parameter
Removed a single-use temporary variable being cast from sprite frame to direction to size_t
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Fix alignment of WalkSettings array
5 years ago
Anders Jenbo
41f6b62caa
Fix infinit loop if first word overflows the text box
...
Fixes #2829
5 years ago
Anders Jenbo
7169882b1f
✨ Implement new font rendering
5 years ago
Juliano Leal Goncalves
5bb7b0bf23
♻️ Reduce visibility of 'Displacement::fromDirection' to 'private'
...
This will enforce the new constructor conversion approach over the use of the static method.
5 years ago
Juliano Leal Goncalves
32e22a16b3
♻️ Leverage conversion constructor for 'Direction' to 'Displacement'
...
This makes code more consistent overall as we use the same pattern for dealing with Sizes.
5 years ago
Juliano Leal Goncalves
244235d1de
🏷️ Add explicit conversion constructor on 'Displacement' from 'Direction'
...
We'll leverage this for consistency with other conversions which similarly use a conversion constructor instead of a static method like 'fromDirection'.
5 years ago
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