summaryrefslogtreecommitdiff
path: root/Camera.h
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2018-07-26 21:15:59 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2018-07-26 21:15:59 +0200
commitbfdc0b9f497ef10f6687abcc55d93405c611af11 (patch)
tree43914b2eada0bf5fb09093d61a250d4930b57a5d /Camera.h
parent853c6cddaa2713a9eb0c1f1c55e3f61592f04a46 (diff)
downloadpocketempires-bfdc0b9f497ef10f6687abcc55d93405c611af11.tar.gz
* Menu.cpp: actions for CHOICE_SINGLE_PLAYER_GAME have been moved to a new function called MainMenuSinglePlayer().
+ BaseUnit.cpp, BaseUnit.h: new _selected flag. + Camera.cpp, Camera.h: linear movement has been taken over quadratic movement. Also, cursor now moves if dealing with screen borders. + Cursor.cpp, Cursor.h: new Cursor class holds cursor X/Y information. It is meant to be contained inside a HumanPlayer object. * Game.cpp: minor changes in casts and comments. + HumanPlayer.cpp: added callbacks for button release events. * HumanPlayer.cpp, HumanPlayerBtn.cpp: button handling has been transferred from HumanPlayer.cpp to HumanPlayerBtn.cpp in order to improve modularity. + Sprite.cpp: sprite data was not being checked against NULL. - Unit.cpp: drawHandler() is now executed by Player object.
Diffstat (limited to 'Camera.h')
-rw-r--r--Camera.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/Camera.h b/Camera.h
index d9d02f0..6ff3045 100644
--- a/Camera.h
+++ b/Camera.h
@@ -5,7 +5,9 @@
* Includes
* *************************************/
+#include "Cursor.h"
#include <stdint.h>
+#include <stdbool.h>
/* *************************************
* Defines
@@ -23,26 +25,21 @@ class Camera
{
public:
Camera(void);
- void handler(void);
- void setLock(const bool bLock)
- {
- _bLocked = bLock;
- }
+ void adjustLock(const bool bLock);
+ bool isLocked(void) const;
uint8_t getX(const uint8_t x) const;
uint8_t getY(const uint8_t y) const;
/* Event handlers. */
- void onLeftBtnPressed(void);
- void onRightBtnPressed(void);
- void onUpBtnPressed(void);
- void onDownBtnPressed(void);
+ void onLeftBtnPressed(Cursor& cursor);
+ void onRightBtnPressed(Cursor& cursor);
+ void onUpBtnPressed(Cursor& cursor);
+ void onDownBtnPressed(Cursor& cursor);
private:
bool _bLocked;
int16_t _xOffset;
int16_t _yOffset;
- int16_t _xSpeed;
- int16_t _ySpeed;
uint8_t _speedTimer;
};