-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewport.cpp
37 lines (31 loc) · 863 Bytes
/
viewport.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <sstream>
#include "viewport.h"
#include <math.h>
#include "ioMod.h"
Viewport& Viewport::getInstance() {
static Viewport viewport;
return viewport;
}
Viewport::Viewport() :
gdata(Gamedata::getInstance()),
viewPos(0, 0),
msgPos(
Vector2f( gdata.getXmlInt("view/loc/x"), gdata.getXmlInt("view/loc/y") )
),
worldWidth(gdata.getXmlInt("background/width")),
worldHeight(gdata.getXmlInt("background/height")),
viewWidth(gdata.getXmlInt("view/width")),
viewHeight(gdata.getXmlInt("view/height")),
objWidth(0), objHeight(0),
objectToTrack(NULL)
{}
void Viewport::setObjectToTrack(const Drawable *obj) {
objectToTrack = obj;
objWidth = objectToTrack->getScaledWidth();
objHeight = objectToTrack->getScaledHeight();
}
void Viewport::draw() const {
//std::cout<<"drawing viewport"<<std::endl;
}
void Viewport::update() {
}