source: trunk/deushax/mapviewer.cpp @ 686

Last change on this file since 686 was 686, checked in by sam, 10 years ago

Put everything in the "lol" namespace. Better late than never.

  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1//
2// Deus Hax (working title)
3// Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
4//
5
6#if defined HAVE_CONFIG_H
7#   include "config.h"
8#endif
9
10#include <cstdio>
11
12#include "core.h"
13
14using namespace lol;
15
16#include "mapviewer.h"
17
18/*
19 * MapViewer implementation class
20 */
21
22class MapViewerData
23{
24    friend class MapViewer;
25
26private:
27    Map *map;
28    int x, y;
29    int povx, povy;
30    int done;
31};
32
33/*
34 * Public MapViewer class
35 */
36
37MapViewer::MapViewer(char const *mapname)
38  : data(new MapViewerData())
39{
40    data->map = new Map(mapname);
41    data->x = data->y = 0;
42    data->done = 0;
43}
44
45MapViewer::~MapViewer()
46{
47    delete data->map;
48    delete data;
49}
50
51void MapViewer::TickGame(float deltams)
52{
53    Entity::TickGame(deltams);
54}
55
56void MapViewer::TickDraw(float deltams)
57{
58    Entity::TickDraw(deltams);
59
60    data->map->Render(-data->povx, -data->povy, 0);
61}
62
63int MapViewer::GetWidth()
64{
65    return data->map->GetWidth();
66}
67
68int MapViewer::GetHeight()
69{
70    return data->map->GetHeight();
71}
72
73void MapViewer::SetPOV(int x, int y)
74{
75    data->povx = x;
76    data->povy = y;
77}
78
Note: See TracBrowser for help on using the repository browser.