// // Deus Hax (working title) // Copyright (c) 2010 Sam Hocevar // #if defined HAVE_CONFIG_H # include "config.h" #endif #include #include "core.h" #include "mapviewer.h" /* * MapViewer implementation class */ class MapViewerData { friend class MapViewer; private: Map *map; int x, y; int povx, povy; int done; }; /* * Public MapViewer class */ MapViewer::MapViewer(char const *mapname) : data(new MapViewerData()) { data->map = new Map(mapname); data->x = data->y = 0; data->done = 0; } MapViewer::~MapViewer() { delete data->map; delete data; } void MapViewer::TickGame(float deltams) { Entity::TickGame(deltams); } void MapViewer::TickDraw(float deltams) { Entity::TickDraw(deltams); data->map->Render(-data->povx, -data->povy, 0); } int MapViewer::GetWidth() { return data->map->GetWidth(); } int MapViewer::GetHeight() { return data->map->GetHeight(); } void MapViewer::SetPOV(int x, int y) { data->povx = x; data->povy = y; }