* Add MakeRectangle helper to convert from SDL_Rect
* Add Rectangle::inset method for shrinking a rectangle
Turns out some of the other use cases I though this could apply to were actually doing something based on a fixed region
* Simplify initialisation of settings menu rects
* Use appropriate types for size constants in control.cpp
* Declare constexpr value for iterating over the cells in a stash grid
* Use appropriate type for UIRectangle dimensions
Reduces peak memory consuption in game by ~420 KiB.
This is because the PCX renderer applies the palette on the fly while
rendering, meaning we do not need to duplicate the font for different
palettes.
This approach is also a bit slower than precomposed palettes (still
plenty fast).
eventually maybe we can move to fixed point approximations instead of using hypot and casts to double/float? probably way slower than using the FPU on modern systems though :D
This matches the behaviour of inventory cell hit logic. Previously it was possible to click exactly on a border and be unable to put an item in the stash.
This OOB happened when rendering a sprite so that it is exactly
off-screen (touching the border but not visible) on top/bottom
while also being only partly off-screen on the left or right.
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.
Previously, the memory for each frame was allocated separately.
Changes it to allocate a single buffer for all the frames.
This has the following advantages:
1. Less bookkeeping overhead in the allocator.
2. Less alignment overhead (allocator results are max-aligned by default).
We can follow this up with a similar treatment for other multi-file
animations.