ScummVM API documentation
spinner.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 BLADERUNNER_SPINNER_H
23#define BLADERUNNER_SPINNER_H
24
25#include "common/array.h"
26#include "common/rect.h"
27
28namespace BladeRunner {
29
30class BladeRunnerEngine;
31class SaveFileReadStream;
32class SaveFileWriteStream;
33class Shapes;
34class UIImagePicker;
35class VQAPlayer;
36
37class Spinner {
38 static const int kSpinnerDestinations = 10;
39
40 struct Destination {
41 int id;
42 Common::Rect rect;
43 int shapeId;
44 int shapeIdOver;
45 };
46
48 bool _isDestinationSelectable[kSpinnerDestinations];
49 bool _isOpen;
50 VQAPlayer *_vqaPlayer;
51 const Destination *_destinations;
52 int _selectedDestination;
53 Shapes *_shapes;
54 UIImagePicker *_imagePicker;
55
56 int _actorId;
57 int _sentenceId;
58 uint32 _timeSpeakDescriptionStart;
59
60public:
62 ~Spinner();
63
64 void setSelectableDestinationFlag(int destination, bool selectable);
65 bool querySelectableDestinationFlag(int destination) const;
66
67 int chooseDestination(int vqaLoopId, bool immediately);
68
69 void open();
70 bool isOpen() const;
71
72 int handleMouseUp(int x, int y);
73 int handleMouseDown(int x, int y);
74
75 void tick();
76 void setSelectedDestination(int destination);
77 void reset();
78 void resume();
79
80 void destinationFocus(int destination);
81 void setupDescription(int actorId, int sentenceId);
82 void resetDescription();
83 void tickDescription();
84
85 void save(SaveFileWriteStream &f);
86 void load(SaveFileReadStream &f);
87
88private:
89 static void mouseInCallback(int, void *);
90 static void mouseOutCallback(int, void *);
91 static void mouseDownCallback(int, void *);
92 static void mouseUpCallback(int, void *);
93 static const Destination *getDestinationsFar();
94 static const Destination *getDestinationsMedium();
95 static const Destination *getDestinationsNear();
96};
97
98} // End of namespace BladeRunner
99
100#endif
Definition: bladerunner.h:113
Definition: savefile.h:113
Definition: savefile.h:88
Definition: shape.h:61
Definition: spinner.h:37
Definition: ui_image_picker.h:40
Definition: vqa_player.h:45
Definition: rect.h:536