4 * Created on: Sep 29, 2012
11 #include "../app/Application.h"
12 #include "../app/Input.h"
14 using app::Application;
16 using geometry::Vector;
20 MapState::MapState(const Map *map)
23 , camera(100, 100, &tempTarget) {
28 void MapState::EnterState(Application &ctrl, SDL_Surface *screen) {
29 camera.Resize(screen->w, screen->h);
32 void MapState::ExitState(Application &ctrl, SDL_Surface *screen) {
36 void MapState::ResumeState(Application &ctrl, SDL_Surface *screen) {
37 camera.Resize(screen->w, screen->h);
40 void MapState::PauseState(Application &ctrl, SDL_Surface *screen) {
44 void MapState::Resize(int width, int height) {
45 camera.Resize(width, height);
49 void MapState::HandleEvents(const Input &input) {
53 void MapState::UpdateWorld(float deltaT) {
57 void MapState::Render(SDL_Surface *screen) {
58 Vector<int> offset(camera.CalculateOffset());
59 map->Render(screen, offset);