-
Committer:
Bunnybot
-
Date:
2016-10-24 20:32:29 UTC
-
mfrom:
(8131.2.42 zoom)
-
Revision ID:
bunnybot@raspberrypi-20161024203229-0q9eolrxn69u0eoq
Merged lp:~widelands-dev/widelands/zoom:
- Adds mouse wheel zoom to the MapView and adapt code for these changes.
- Overlays (text & soldier icons) are drawn at integer scale only and not at all once scale is < 0.5.
- This required to change all blitting to be sub-pixel - i.e. float - for the 'destination'.
- Adapted and simplified minimap rendering. It gained a feature too: Minimaps can be drawn using two modes :
- the map scrolls and the view window stands still (the old one, stil used for in-game)
- the view window scrolls and the map always looks like the minimap preview. This is now used in the editor.
- Renames Vector -> Vector3f, Point -> Vector2i, Pointf -> Vector2f, Rect -> Recti, FloatRect -> Rectf.
- Refactored object drawing to be simpler and slightly faster:
- Never pass the field to be drawn to the draw routine.
- Do not calculate if statics or census should be shown inside the draw routines of the objects, but outside.
- Move 'owner' field to MapObject - it was duplicated on Bob, Immovable and PlayerImmovable.
Known issues that I will not fix in this branch:
Lua is not aware of zoom and uses zoomless calculations for its moving functions of the view. That means that if the player has zoomed in a scenario and the code wants to move to a certain field, the movement will be wrong. My plan is to remove the Lua functions and add a Animator class to the MapView that will do smooth animations over time in the next branch.