ScummVM API documentation
camera.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 NANCY_UI_TASKBAR_CAMERA_H
23 #define NANCY_UI_TASKBAR_CAMERA_H
24 
25 #include "engines/nancy/enginedata.h"
26 #include "engines/nancy/renderobject.h"
27 
28 namespace Nancy {
29 
30 struct NancyInput;
31 
32 namespace UI {
33 
34 // The standalone camera introduced in Nancy14 (UICM), switched on by its photo
35 // album (CameraAction). While it is on, a viewfinder box follows the cursor
36 // and the scene's hotspots and panning are suppressed; a click photographs
37 // every subject the box frames.
38 class Camera : public RenderObject {
39 public:
40  Camera() : RenderObject(9) {}
41  virtual ~Camera() {}
42 
43  void init() override;
44 
45  // itemID is the inventory item whose close-up is the photo album, or -1.
46  void activate(int16 itemID = -1);
47  void deactivate();
48  bool isActive() const { return _isActive; }
49 
50  void handleInput(NancyInput &input);
51 
52  // -- The camera roll, shared with the photo album --
53 
54  static uint numPictures();
55  // Publishes the roll's size to the game variable UICM names, if it names one.
56  static void setPictureCount(uint count);
57  static void playSoundBlock(const RandomSoundBlock &block);
58 
59 protected:
60  // UICM's picture size, centred on the cursor and kept inside the viewport.
61  Common::Rect viewfinderScreenRect() const;
62  void drawViewfinder();
63  void takePicture();
64  void returnToAlbum();
65 
66  const UICM *_cameraData = nullptr;
68  Common::Point _aimPoint;
69  int16 _itemID = -1;
70  bool _isActive = false;
71 };
72 
73 } // End of namespace UI
74 } // End of namespace Nancy
75 
76 #endif // NANCY_UI_TASKBAR_CAMERA_H
Definition: managed_surface.h:51
Definition: camera.h:38
Definition: rect.h:536
Definition: input.h:41
Definition: soundequalizerpuzzle.h:27
Definition: renderobject.h:36
Definition: commontypes.h:324
Definition: rect.h:144
Definition: enginedata.h:801
Definition: actionmanager.h:32