ScummVM API documentation
vr.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 PHOENIXVR_VR_H
23 #define PHOENIXVR_VR_H
24 
25 #include "common/array.h"
26 #include "common/stream.h"
27 #include "graphics/managed_surface.h"
28 #include "graphics/pixelformat.h"
29 
30 namespace Graphics {
31 struct Surface;
32 class Screen;
33 } // namespace Graphics
34 
35 namespace PhoenixVR {
36 class RegionSet;
37 class VR {
39  bool _vr = false;
40  struct Animation {
41  struct Frame {
42  Common::Array<byte> blockData;
43  int restartAtFrame = -1;
44  void render(Graphics::Surface &pic) const;
45  };
46 
47  Common::String name;
48  Common::Array<Frame> frames;
49 
50  bool active = false;
51  float t = 0;
52  float speed = 25.0f;
53 
54  unsigned frameIndex = 0;
55 
56  Common::String variable;
57  int variableValue = 0;
58  void renderNextFrame(Graphics::Surface &pic);
59  void render(Graphics::Surface &pic, float dt);
60  };
61  Common::Array<Animation> _animations;
62  float _hint = 0;
63  bool _showWaves = false;
64  float _wavesT = 0;
65 
66 public:
67  static VR loadStatic(const Graphics::PixelFormat &format, Common::SeekableReadStream &s);
68  void render(Graphics::Screen *screen, float ax, float ay, float fov, float dt, RegionSet *regSet);
69  bool isVR() const { return _vr; }
70  void playAnimation(const Common::String &name, const Common::String &variable, int value, float speed);
71  void stopAnimation(const Common::String &name);
72  Graphics::Surface &getSurface() { return *_pic->surfacePtr(); }
73  void showWaves() { _showWaves = true; }
74 };
75 } // namespace PhoenixVR
76 
77 #endif
Definition: str.h:59
Definition: surface.h:67
Definition: pixelformat.h:138
Definition: atari-screen.h:58
Definition: stream.h:745
Definition: screen.h:48
Definition: angle.h:33
Definition: formatinfo.h:28
Definition: vr.h:37
Definition: region_set.h:48