Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

detrumi
Copy link
Contributor

@detrumi detrumi commented Jun 29, 2015

Fixed point numbers, to replace the int_64 and related calculations on the phys_t type. This also removes the ugly settings namespace.

It compiles, but still has quite some bugs I'm currently fixing (I'll also be moving it to the util namespace).

@@ -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;
Copy link
Member

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

@mic-e
Copy link
Member

mic-e commented Jun 29, 2015

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) {
Copy link
Member

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.

@TheJJ TheJJ added improvement Enhancement of an existing component lang: c++ Done in C++ code in progress labels Jun 30, 2015
@TheJJ
Copy link
Member

TheJJ commented Aug 19, 2015

hows this going? are you having problems with the big folder structure change? you want git rebase -m -i upstream/master to make your life easier.

@TheJJ TheJJ mentioned this pull request Sep 14, 2015
@TheJJ TheJJ removed the in progress label Sep 28, 2016
@mic-e mic-e mentioned this pull request Nov 1, 2016
6 tasks
@TheJJ
Copy link
Member

TheJJ commented Jan 17, 2017

superseeded by #662

@TheJJ TheJJ closed this Jan 17, 2017
@TheJJ
Copy link
Member

TheJJ commented Feb 19, 2018

went upstream in #975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants