-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Fixed point numbers #322
Conversation
@@ -678,7 +678,7 @@ void ProjectileProducer::initialise(Unit *unit, Player &) { | |||
unit->graphics = &this->graphics; | |||
|
|||
// projectile speed | |||
coord::phys_t sp = this->unit_data.speed * coord::settings::phys_per_tile / 666; | |||
coord::phys_t sp = coord::phys_t{this->unit_data.speed} / 666; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
projectile speed of the beast
This looks pretty nice, so far. A lot of the ugliness that resulted from my earlier hacks has been removed. |
constexpr FixedPoint() : data(0) { | ||
} | ||
|
||
constexpr FixedPoint(int_type n) : data(n << fractional_bits) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want those single-argument constructors to be explicit
to prevent some implicit conversions.
hows this going? are you having problems with the big folder structure change? you want |
superseeded by #662 |
went upstream in #975 |
Fixed point numbers, to replace the int_64 and related calculations on the
phys_t
type. This also removes the uglysettings
namespace.It compiles, but still has quite some bugs I'm currently fixing (I'll also be moving it to the
util
namespace).