fpw / avitab

X-Plane plugin that displays a tablet to aid VR usage
GNU Affero General Public License v3.0
299 stars 58 forks source link

Implement datarefs to report map coordinates, zoom and range #202

Closed mjh65 closed 3 months ago

mjh65 commented 5 months ago

This PR implements the enhancement requested in https://github.com/fpw/avitab/issues/198.

The first commit refactors some existing code to put a small wrapper class around the X-Plane API calls. Despite this, the callbacks are still a little more 'C' than 'C++' (reinterpret casts are used), and perhaps could be improved by some more complex (and less readable?) template code.

The second commit adds 4 new datarefs to allow other X-Plane components to obtain the Avitab map coordinates (map centre), the zoom level, and an approximation of the distance from top to bottom of the visible map.