ScummVM API documentation
qd_camera_mode.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
23#ifndef QDENGINE_QDCORE_QD_CAMERA_MODE_H
24#define QDENGINE_QDCORE_QD_CAMERA_MODE_H
25
26#include "qdengine/xmath.h"
27#include "qdengine/parser/xml_fwd.h"
28
29namespace Common {
30class SeekableReadStream;
31class WriteStream;
32}
33
34namespace QDEngine {
35
36class qdGameObjectState;
37class qdGameObjectAnimated;
38
41public:
43 ~qdCameraMode() { }
44
57 };
58
59 void set_camera_mode(camera_mode_t mode) {
60 _camera_mode = mode;
61 }
62 camera_mode_t camera_mode() const {
63 return _camera_mode;
64 }
65
66 void set_work_time(float tm) {
67 _work_time = tm;
68 }
69 float work_time() const {
70 return _work_time;
71 }
72 bool has_work_time() const {
73 return _work_time > 0.001f;
74 }
75
76 void set_scrolling_speed(float v) {
77 _scrolling_speed = v;
78 }
79 float scrolling_speed() const {
80 return _scrolling_speed;
81 }
82
83 void set_scrolling_distance(int dist) {
84 _scrolling_distance = dist;
85 }
86 int scrolling_distance() const {
87 return _scrolling_distance;
88 }
89
90 bool smooth_switch() const {
91 return _smooth_switch;
92 }
93 void set_smooth_switch(bool v) {
94 _smooth_switch = v;
95 }
96
97 const Vect2i &center_offset() const {
98 return _center_offset;
99 }
100 void set_center_offset(const Vect2i &offs) {
101 _center_offset = offs;
102 }
103
104 bool load_script(const xml::tag *p);
105 bool save_script(Common::WriteStream &fh, int indent = 0) const;
106
108 bool load_data(Common::SeekableReadStream &fh, int save_version);
111
112private:
113
115 camera_mode_t _camera_mode;
116
118
125 float _work_time;
126
128 float _scrolling_speed;
129
131
137 int _scrolling_distance;
138
140
144 Vect2i _center_offset;
145
147 bool _smooth_switch;
148};
149
150} // namespace QDEngine
151
152#endif // QDENGINE_QDCORE_QD_CAMERA_MODE_H
Definition: stream.h:745
Definition: stream.h:77
Definition: xmath.h:268
Режим работы камеры.
Definition: qd_camera_mode.h:40
bool save_data(Common::WriteStream &fh) const
Запись данных в сэйв.
camera_mode_t
идентификаторы режимов камеры
Definition: qd_camera_mode.h:46
@ MODE_FOLLOW_OBJECT
камера все время центруется на объекте
Definition: qd_camera_mode.h:52
@ MODE_CENTER_OBJECT
камера жестко привязана к объекту
Definition: qd_camera_mode.h:50
@ MODE_CENTER_OBJECT_WHEN_LEAVING
когда объект подходит к краю экрана камера плавно на нем центруется
Definition: qd_camera_mode.h:54
@ MODE_OBJECT_ON_SCREEN
камера не выпускает объект с экрана
Definition: qd_camera_mode.h:48
@ MODE_UNASSIGNED
режим не установлен
Definition: qd_camera_mode.h:56
bool load_data(Common::SeekableReadStream &fh, int save_version)
Загрузка данных из сэйва.
Definition: algorithm.h:29
Базовый класс для игровых ресурсов.
Definition: console.h:28