-
Notifications
You must be signed in to change notification settings - Fork 0
/
WorldRenderer.cpp
52 lines (34 loc) · 951 Bytes
/
WorldRenderer.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "WorldRenderer.h"
#include "Camera.h"
#include "../server/GameAssets/Map.h"
WorldRenderer::WorldRenderer(){
}
WorldRenderer::~WorldRenderer(){
}
DrawableMapPtr WorldRenderer::getMap(){
return m_map;
}
Camera& WorldRenderer::getCamera(){
return m_camera;
}
void WorldRenderer::init(){
}
void WorldRenderer::unload(){
}
void WorldRenderer::update(sf::Time frameTime){
//sf::Uint32 posX = me.getPosition().getMapXY().x * 32;
//sf::Uint32 posY = me.getPosition().getMapXY().y * 32;
//if (posX + 400 < m_map->getMap()->getSize().x * 32)
// m_camera.updateX(posX);
//if (posY + 300 < m_map->getMap()->getSize().y * 32)
// m_camera.updateY(posY);
m_camera.update();
//m_map->setView(m_camera.getView());
//me.update(frameTime);
}
void WorldRenderer::render(sf::RenderTarget* target){
target->setView(m_camera.getView());
//target->draw(*m_map.get());
//target->draw(me);
target->setView(target->getDefaultView());
}