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 
29 namespace Common {
30 class SeekableReadStream;
31 class WriteStream;
32 }
33 
34 namespace QDEngine {
35 
36 class qdGameObjectState;
37 class qdGameObjectAnimated;
38 
40 class qdCameraMode {
41 public:
42  qdCameraMode();
43  ~qdCameraMode() { }
44 
56  MODE_UNASSIGNED
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);
110  bool save_data(Common::WriteStream &fh) const;
111 
112 private:
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:77
камера жестко привязана к объекту
Definition: qd_camera_mode.h:50
камера все время центруется на объекте
Definition: qd_camera_mode.h:52
Definition: stream.h:745
XML тег.
Definition: xml_tag.h:33
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: xmath.h:268
когда объект подходит к краю экрана камера плавно на нем центруется
Definition: qd_camera_mode.h:54
Режим работы камеры.
Definition: qd_camera_mode.h:40
Definition: algorithm.h:29
камера не выпускает объект с экрана
Definition: qd_camera_mode.h:48
camera_mode_t
идентификаторы режимов камеры
Definition: qd_camera_mode.h:46