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

Refactor dxDrawCircle to use primitives queue, fix it's postGui issues #618

Merged
merged 3 commits into from
Sep 30, 2018

Conversation

forkerer
Copy link
Contributor

@forkerer forkerer commented Sep 29, 2018

Fixes #432, #431.

As the title suggest, this pull request forces dxDrawCircle to use primitives drawing, and fixes it's postGui issues. It also includes a bit of general code cleanup and removal of unnecessary vertices creation. I tried to test most of the common scenarios with that, and couldn't find any issues.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.

fStartAngle = D3DXToRadian(fStartAngle);
fStopAngle = D3DXToRadian(fStopAngle);
// Calculate each segment angle
const float kfSegmentAngle = (fStopAngle - fStartAngle) / (siSegments-1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember removing -1 in (siSegments-1), and it worked without any issues. Any reason for adding it back?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of floating point based loop, i made it to use exactly the amount of segments specified in dxDrawCircle call, that required adding -1 again

@ccw808 ccw808 merged commit d28393f into multitheftauto:master Sep 30, 2018
@ccw808
Copy link
Member

ccw808 commented Sep 30, 2018

Thank you

@patrikjuvonen patrikjuvonen added this to the 1.5.7 milestone Jan 5, 2019
@patrikjuvonen patrikjuvonen added bug Something isn't working refactor labels Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dxDrawCircle: Not rendered at all if postGUI is enabled
3 participants