Closed richelbilderbeek closed 5 years ago
I believe this is also done already
Op zo 17 mrt. 2019 13:14 schreef Richel Bilderbeek <notifications@github.com
:
Is your feature request related to a problem? Please describe.
Currently, we use an SFML view (#496 https://github.com/richelbilderbeek/djog_unos_2018/issues/496). Using such a view allows us to move the camera in any direction, zoom in/out and rotate.
However, there are a lot of magic numbers in the code that code for the transformation that should be done by the view:
void game::spawn(agent_type type, tile t) { // ... move_agent_to_tile(a1, t.get_x()/122, t.get_y()/122); // ... }
Describe the solution you'd like
Replace the magic numbers by usage of the view.
I do not know the exact syntax, but the 122 should be something like the view's zoom factor instead.
Describe alternatives you've considered
None.
Additional context
None.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/richelbilderbeek/djog_unos_2018/issues/498, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab-Tki9WKiRKJxk5E4WTL6jtIMvJK9e8ks5vXjGpgaJpZM4b4WF2 .
Cool! In which branch are there no more magic numbers? I see in develop
they are still around.
Also, the 122 should not change at all ever, the 122 is the translation from the actual sfml view coordinate to tile placement coordinate
everything is placed in sfml with m_window.mapPixelToCoords() meaning it is already mapped to the view
will reopen if zooming does not work correctly after all
Fantastic! Go team :1st_place_medal:
Is your feature request related to a problem? Please describe.
Currently, we use an SFML view (#496). Using such a view allows us to move the camera in any direction, zoom in/out and rotate.
However, there are a lot of magic numbers in the code that code for the transformation that should be done by the view:
Describe the solution you'd like
Replace the magic numbers by usage of the view.
I do not know the exact syntax, but the
122
should be something like the view's zoom factor instead.Describe alternatives you've considered
None.
Additional context
None.