-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Remove old Rect, Point and Size classes #3316
Conversation
to allow to use proper types and fix a lot of compilation warnings.
Hi @oleg-derevenetz and @idshibanov , This pull request is made to complete our long term transition from old engine to new engine, which we initially introduced in 0.8.1 version. Old Rect, Size and Point classes were based on 16-bit values, causing a lot of compilation warnings. This was one of the reasons why we disable implicit type casting checks during compilation. Could you please review it as it's a huge one and I might missed something or overdid? |
const int16_t x = static_cast<int16_t>( st.center.x ); | ||
const int16_t y = static_cast<int16_t>( st.center.y ); | ||
|
||
return sb << x << y; |
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.
Great, that's what I was looking for. Every time we serialize a point, we'll have to convert to 16bit for now for compatibility.
Tested branch locally, looks good to me.
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.
LGTM. Just curious - is it worth to move such base classes like Point, Size and Rect to separate namespace and add fheroes2::
everywhere?
That's what we have right now. Old classes were outside any namespace while new Point, Size and Rect classes are within fheroes2 namespace. They both existed before. |
I mean, is it justified? Why not move new classes to global namespace instead of adding |
We already had a lot of places using |
SonarCloud Quality Gate failed. |
to allow to use proper types and fix a lot of compilation warnings.