ScummVM API documentation
qd_game_object_static.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 QDENGINE_QDCORE_QD_GAME_OBJECT_STATIC_H
23#define QDENGINE_QDCORE_QD_GAME_OBJECT_STATIC_H
24
25#include "qdengine/qdcore/qd_sprite.h"
26#include "qdengine/qdcore/qd_game_object.h"
27
28
29namespace QDEngine {
30
32public:
35
36 int named_object_type() const {
37 return QD_NAMED_OBJECT_STATIC_OBJ;
38 }
39
40 const qdSprite *get_sprite() const {
41 return &_sprite;
42 }
43 qdSprite *get_sprite() {
44 return &_sprite;
45 }
46
47 void redraw(int offs_x = 0, int offs_y = 0) const;
48 void debug_redraw() const { }
49 void draw_contour(uint32 color) const;
50 void draw_shadow(int offs_x, int offs_y, uint32 color, int alpha) const { }
51
52 bool load_script(const xml::tag *p);
53 bool save_script(Common::WriteStream &fh, int indent = 0) const;
54
55 bool mouse_handler(int x, int y, mouseDispatcher::mouseEvent ev) {
56 return false;
57 }
58
59 bool load_resources();
60 void free_resources();
61
62 Vect2s screen_size() const {
63 return Vect2s(_sprite.size_x(), _sprite.size_y());
64 }
65
66 bool hit(int x, int y) const;
67
68protected:
69
70 bool load_script_body(const xml::tag *p);
71 bool save_script_body(Common::WriteStream &fh, int indent = 0) const;
72
73private:
74 qdSprite _sprite;
75};
76
77} // namespace QDEngine
78
79#endif // QDENGINE_QDCORE_QD_GAME_OBJECT_STATIC_H
Definition: stream.h:77
mouseEvent
События.
Definition: mouse_input.h:41
Базовый класс для игровых объектов.
Definition: qd_game_object.h:53
Definition: qd_game_object_static.h:31
int named_object_type() const
Возвращает тип объекта.
Definition: qd_game_object_static.h:36
Спрайт.
Definition: qd_sprite.h:39
Базовый класс для игровых ресурсов.
Definition: console.h:28