ScummVM API documentation
map.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ULTIMA2_VIEWS_MAP_H
23#define ULTIMA2_VIEWS_MAP_H
24
25#include "ultima/shared/engine/view.h"
26#include "ultima/ultima2/data/tiles.h"
27
28namespace Ultima {
29namespace Ultima2 {
30namespace Views {
31
32using namespace Graphics::Views;
33
37class Map : public Shared::View {
38public:
39private:
40 uint32 _lastAnimation = 0;
41 uint32 _lastInput = 0;
42
43 // A sprite currently being flashed over the view, see flashSprite
44 const Graphics::ManagedSurface *_flashSprite = nullptr;
45 Common::Point _flashPos;
46
47protected:
52
56 void checkIdle();
57
64
71 void flashSprite(const Graphics::ManagedSurface &sprite, const Common::Point &pos);
72
73public:
81 virtual void reloadTiles() {}
82
83 Map(const Common::String &name) : View(name) {
84 _bounds = Graphics::Views::TextRect(0, 0, 39, 19);
85 }
86 ~Map() override {}
87
88 bool msgFocus(const FocusMessage &msg) override;
89 bool msgAction(const ActionMessage &msg) override;
90 bool msgKeypress(const KeypressMessage &msg) override;
91 bool tick() override;
92};
93
94} // namespace Views
95} // namespace Ultima2
96} // namespace Ultima
97
98#endif
Definition: str.h:59
Definition: managed_surface.h:51
Definition: gfx_surface.h:34
Definition: rect.h:44
Definition: view.h:41
Definition: view.h:35
Definition: map.h:37
virtual void reloadTiles()
Definition: map.h:81
void finishGraphics(Graphics::Views::GfxSurface &s)
virtual Graphics::Surface * tileGraphics()=0
void flashSprite(const Graphics::ManagedSurface &sprite, const Common::Point &pos)
Definition: rect.h:144
Definition: surface.h:67
Definition: messages.h:118
Definition: messages.h:42
Definition: messages.h:54