Last change
on this file since 735 was
735,
checked in by sam, 10 years ago
|
core: get rid of now useless <cstdio> includes.
|
-
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 "core.h" |
---|
11 | |
---|
12 | using namespace lol; |
---|
13 | |
---|
14 | #include "mapviewer.h" |
---|
15 | |
---|
16 | /* |
---|
17 | * MapViewer implementation class |
---|
18 | */ |
---|
19 | |
---|
20 | class MapViewerData |
---|
21 | { |
---|
22 | friend class MapViewer; |
---|
23 | |
---|
24 | private: |
---|
25 | Map *map; |
---|
26 | int x, y; |
---|
27 | int povx, povy; |
---|
28 | int done; |
---|
29 | }; |
---|
30 | |
---|
31 | /* |
---|
32 | * Public MapViewer class |
---|
33 | */ |
---|
34 | |
---|
35 | MapViewer::MapViewer(char const *mapname) |
---|
36 | : data(new MapViewerData()) |
---|
37 | { |
---|
38 | data->map = new Map(mapname); |
---|
39 | data->x = data->y = 0; |
---|
40 | data->done = 0; |
---|
41 | } |
---|
42 | |
---|
43 | MapViewer::~MapViewer() |
---|
44 | { |
---|
45 | delete data->map; |
---|
46 | delete data; |
---|
47 | } |
---|
48 | |
---|
49 | void MapViewer::TickGame(float deltams) |
---|
50 | { |
---|
51 | Entity::TickGame(deltams); |
---|
52 | } |
---|
53 | |
---|
54 | void MapViewer::TickDraw(float deltams) |
---|
55 | { |
---|
56 | Entity::TickDraw(deltams); |
---|
57 | |
---|
58 | data->map->Render(-data->povx, -data->povy, 0); |
---|
59 | } |
---|
60 | |
---|
61 | int MapViewer::GetWidth() |
---|
62 | { |
---|
63 | return data->map->GetWidth(); |
---|
64 | } |
---|
65 | |
---|
66 | int MapViewer::GetHeight() |
---|
67 | { |
---|
68 | return data->map->GetHeight(); |
---|
69 | } |
---|
70 | |
---|
71 | void MapViewer::SetPOV(int x, int y) |
---|
72 | { |
---|
73 | data->povx = x; |
---|
74 | data->povy = y; |
---|
75 | } |
---|
76 | |
---|
Note: See
TracBrowser
for help on using the repository browser.