Enables safe parts of the hardware cursor by default:
1. Disabled for items due to the jumping glitch.
2. Limited to 128px size due to buggy large cursors on some systems.
This avoids forcing floating point conversions, the operation can safely be expressed as integral operations given the range of GenerateRnd and the types chosen for MonsterStruct::m*Damage*
This was giving type conversion warnings for the forced int > double > int conversion. The int + int operation in the middle was also flagged as it gets upcast during the multiplication (despite the values always being well within the range of an int) so using long constants there to avoid it.
This was triggering narrowing conversion warnings in msvc. I assume the compiler can optimise this into a float multiplication if it does turn out faster.
* Clamp hpPer as a sanity check
* Refactor update mana routines in control.cpp to use PlayerStruct::UpdateManaPercentage
* Remove unnecessary calls to UpdateHP/ManaPercentage
* Unify logic that draws the flasks into a single internal function
* Fix style violations
* Remove unnecessary save/loads of hp/manaPer
The way this variable is used expects a value in this range and it gets clamped again anyway, but this makes the code more similar to the manaPer logic for future refactoring
Identical logic in use, the checks to see if the values are negative can be accomplished using clamp and the same divide by zero guard. I'll combine the two attributes in a near future commit.
control_update_life_mana is called during the game loop before any of the drawing functions so hpPer/manaPer are calculated based on the latest current/max of their respective attributes every frame.
There's no need to do the calculation again in the draw routines. (There's also no need to calculate this every frame but that's going to take a bit to untangle.)