summaryrefslogtreecommitdiff
path: root/Camera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Camera.cpp')
-rw-r--r--Camera.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/Camera.cpp b/Camera.cpp
index 1f75875..34aa15b 100644
--- a/Camera.cpp
+++ b/Camera.cpp
@@ -51,15 +51,25 @@ Camera::Camera(void) :
{
}
+uint16_t Camera::getRealX(const int16_t x) const
+{
+ return static_cast<uint16_t>(x + _xOffset);
+}
+
+uint16_t Camera::getRealY(const int16_t y) const
+{
+ return static_cast<uint16_t>(y + _yOffset);
+}
+
/*****************************************************************//**
*
* \brief This function transforms X coordinates for a given
* object to camera coordinates.
*
*********************************************************************/
-uint8_t Camera::getX(const uint8_t x) const
+int16_t Camera::getX(const uint16_t x) const
{
- return x - _xOffset;
+ return static_cast<int16_t>(x - _xOffset);
}
/*****************************************************************//**
@@ -68,9 +78,9 @@ uint8_t Camera::getX(const uint8_t x) const
* object to camera coordinates.
*
*********************************************************************/
-uint8_t Camera::getY(const uint8_t y) const
+int16_t Camera::getY(const uint16_t y) const
{
- return y - _yOffset;
+ return static_cast<int16_t>(y - _yOffset);
}
/*****************************************************************//**