ScummVM API documentation
selector.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 SCI_ENGINE_SELECTOR_H
23 #define SCI_ENGINE_SELECTOR_H
24 
25 #include "common/scummsys.h"
26 
27 #include "sci/engine/vm_types.h" // for reg_t
28 #include "sci/engine/vm.h"
29 
30 namespace Sci {
31 
33 struct SelectorCache {
34  SelectorCache() {
35  memset(this, 0, sizeof(*this));
36  }
37 
38  // Statically defined selectors, (almost the) same in all SCI versions
39  Selector _info_;
40  Selector y;
41  Selector x;
42  Selector view, loop, cel;
43  Selector underBits;
44  Selector nsTop, nsLeft, nsBottom, nsRight;
45  Selector lsTop, lsLeft, lsBottom, lsRight;
46  Selector signal;
47  Selector illegalBits;
48  Selector brTop, brLeft, brBottom, brRight;
49  // name, key, time
50  Selector text;
51  Selector elements;
52  // color, back
53  Selector mode;
54  // style
55  Selector state, font, type;
56  // window
57  Selector cursor;
58  Selector max;
59  Selector mark; //< Used by list controls (script internal, is needed by us for the QfG import rooms)
60  Selector sort; //< Used by list controls (script internal, is needed by us for QfG3 import room)
61  // who
62  Selector message;
63  // edit
64  Selector play;
65  Selector restore;
66  Selector number;
67  Selector handle;
68  Selector nodePtr;
69  Selector client;
70  Selector dx, dy;
71  Selector b_movCnt, b_i1, b_i2, b_di, b_xAxis, b_incr;
72  Selector xStep, yStep;
73  Selector xLast, yLast;
74  Selector moveSpeed;
75  Selector canBeHere;
76  Selector heading, mover;
77  Selector doit;
78  Selector isBlocked, looper;
79  Selector priority;
80  Selector modifiers;
81  Selector replay;
82  // setPri, at, next, done, width
83  Selector wordFail, syntaxFail;
84  // semanticFail, pragmaFail
85  // said
86  Selector claimed;
87  // value, save, restore, title, button, icon, draw
88  Selector delete_;
89  Selector z;
90  Selector setPri;
91 
92  // SCI1+ static selectors
93  Selector parseLang;
94  Selector printLang;
95  Selector subtitleLang;
96  Selector size;
97  Selector points;
98  Selector palette;
99  Selector dataInc;
100  // handle (in SCI1)
101  Selector min;
102  Selector sec;
103  Selector frame;
104  Selector vol;
105  Selector pri;
106  // perform
107  Selector moveDone;
108 
109  // SCI1 selectors which have been moved a bit in SCI1.1, but otherwise static
110  Selector cantBeHere;
111  Selector topString;
112  Selector flags;
113 
114  // SCI1+ audio sync related selectors, not static. They're used for lip syncing in
115  // CD talkie games
116  Selector syncCue;
117  Selector syncTime;
118 
119  // SCI1.1 specific selectors
120  Selector scaleSignal; //< Used by kAnimate() for cel scaling (SCI1.1+)
121  Selector scaleX, scaleY;
122  Selector maxScale;
123  Selector vanishingX;
124  Selector vanishingY;
125 
126  // Used for auto detection purposes
127  Selector overlay;
128 
129  // SCI1.1 Mac icon bar selectors
130  Selector iconIndex;
131  Selector select;
132 
133  Selector handsOff;
134  Selector setStep;
135  Selector setMotion;
136  Selector cycleSpeed;
137  Selector owner;
138 
139  Selector curPos; // for LSL6 volume sync
140  Selector update; // for LSL6 volume sync
141 
142  Selector canInput; // for Phant2 restore from launcher and checking if user has input
143  Selector input; // for checking if user has input
144  Selector controls; // for checking if user has input
145 
146 #ifdef ENABLE_SCI32
147  Selector data; // Used by Array()/String()
148  Selector picture; // Used to hold the picture ID for SCI32 pictures
149  Selector bitmap; // Used to hold the text bitmap for SCI32 texts
150 
151  Selector plane;
152  Selector top, left, bottom, right;
153  Selector resX, resY;
154 
155  Selector fore;
156  Selector back;
157  Selector skip;
158  Selector dimmed;
159  Selector borderColor;
160  Selector width;
161 
162  Selector fixPriority;
163  Selector mirrored;
164  Selector visible;
165 
166  Selector seenRect;
167  Selector useInsetRect;
168  Selector inTop, inLeft, inBottom, inRight;
169  Selector textTop, textLeft, textBottom, textRight;
170  Selector title, titleFont, titleFore, titleBack;
171 
172  Selector magnifier;
173  Selector frameOut;
174  Selector casts; // needed for sync'ing screen items/planes with scripts, when our save/restore code is patched in (see GfxFrameout::syncWithScripts)
175  Selector setVol; // for GK2 volume sync on restore
176  Selector reSyncVol; // for Torin volume sync on restore
177  Selector set; // for LSL6hires subtitle sync
178  Selector clear; // for LSL6hires subtitle sync
179  Selector show; // for GK1 volume sync
180  Selector position; // for GK1 volume sync
181  Selector musicVolume; // for GK1 volume sync
182  Selector soundVolume; // for GK1 volume sync
183  Selector initialOff; // for GK2 volume sync
184  Selector setPos; // for Torin volume sync
185  Selector setSize; // for PQ4 volume sync
186  Selector displayValue; // for PQ:SWAT volume sync
187  Selector new_; // for Torin/LSL7 save/load patching
188  Selector mainCel; // for MGDX volume sync
189  Selector move; // for Phant2 volume sync
190  Selector eachElementDo; // for Phant2 volume sync
191  Selector physicalBar; // for Phant2 volume sync
192  Selector init; // for Phant2 save/load patching
193  Selector scratch; // for Phant2 save/load patching
194  Selector num; // for Phant2 restore from launcher
195  Selector reallyRestore; // for Phant2 restore from launcher
196  Selector bookMark; // for Phant2 auto-save
197  Selector fileNumber; // for RAMA save/load
198  Selector description; // for RAMA save/load
199  Selector dispose; // for RAMA save/load save from launcher
200  Selector masterVolume; // for RAMA volume sync
201  Selector setCel; // for RAMA volume sync
202  Selector value; // for QFG4 import dialog
203 #endif
204 };
205 
209 #define SELECTOR(_slc_) (g_sci->getKernel()->_selectorCache._slc_)
210 
220 reg_t readSelector(SegManager *segMan, reg_t object, Selector selectorId);
221 #define readSelectorValue(segMan, _obj_, _slc_) (readSelector(segMan, _obj_, _slc_).getOffset())
222 
232 void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t value);
233 #define writeSelectorValue(segMan, _obj_, _slc_, _val_) writeSelector(segMan, _obj_, _slc_, make_reg(0, _val_))
234 
238 void invokeSelector(EngineState *s, reg_t object, int selectorId,
239  int k_argc, StackPtr k_argp, int argc = 0, const reg_t *argv = 0);
240 
241 #ifdef ENABLE_SCI32
242 
248 void updateInfoFlagViewVisible(Object *obj, int index, bool fromPropertyOp = false);
249 #endif
250 
251 } // End of namespace Sci
252 
253 #endif // SCI_ENGINE_SELECTOR_H
Selector iconIndex
Used to index icon bar objects.
Definition: selector.h:130
Definition: state.h:100
Selector topString
SCI1 scroll lists use this instead of lsTop. Removed in SCI3.
Definition: selector.h:111
Selector min
SMPTE time format.
Definition: selector.h:101
Selector maxScale
SCI1.1 view scaling, limit for cel, when using global scaling.
Definition: selector.h:122
Selector message
Used by GetEvent.
Definition: selector.h:62
Selector cel
Description of a specific image.
Definition: selector.h:42
Selector canBeHere
Funcselector: Checks for movement validity in SCI0.
Definition: selector.h:75
Selector claimed
Used generally by the event mechanism.
Definition: selector.h:86
Selector syncCue
Used by DoSync()
Definition: selector.h:116
Definition: selector.h:33
Selector underBits
Used by the graphics subroutines to store backupped BG pic data.
Definition: selector.h:43
Selector delete_
Called by Animate() to dispose a view object.
Definition: selector.h:88
void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t value)
Selector mode
Used by text controls (-> DrawControl())
Definition: selector.h:53
Selector modifiers
Used by GetEvent.
Definition: selector.h:80
Selector _info_
Removed in SCI3.
Definition: selector.h:39
Selector doit
Called (!) by the Animate() system call.
Definition: selector.h:77
Selector b_incr
Various Bresenham vars.
Definition: selector.h:71
Selector dy
Deltas.
Definition: selector.h:70
Selector yLast
BR last position of client.
Definition: selector.h:73
Selector mover
Used in DoAvoider.
Definition: selector.h:76
Selector palette
Used by the SCI0-SCI1.1 animate code, unused in SCI2-SCI2.1, removed in SCI3.
Definition: selector.h:98
Selector nodePtr
Replaces handle in SCI1+.
Definition: selector.h:68
Selector scaleY
SCI1.1 view scaling.
Definition: selector.h:121
Selector type
Used by controls.
Definition: selector.h:55
Selector vanishingY
SCI1.1 view scaling, used by global scaling.
Definition: selector.h:124
Selector cursor
Used by EditControl.
Definition: selector.h:57
Definition: object.h:69
Selector moveSpeed
Used for DoBresen.
Definition: selector.h:74
Selector replay
Replay function.
Definition: selector.h:81
Selector overlay
Used to determine if a game is using old gfx functions or not.
Definition: selector.h:127
void invokeSelector(EngineState *s, reg_t object, int selectorId, int k_argc, StackPtr k_argp, int argc=0, const reg_t *argv=0)
Selector looper
Used in DoAvoider.
Definition: selector.h:78
Selector client
The object that wants to be moved.
Definition: selector.h:69
Definition: console.h:28
Selector points
Used by AvoidPath()
Definition: selector.h:97
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
Selector handle
Replaced by nodePtr in SCI1+.
Definition: selector.h:67
Selector illegalBits
Used by CanBeHere.
Definition: selector.h:47
Definition: seg_manager.h:48
Selector text
Used by controls.
Definition: selector.h:50
Selector syntaxFail
Used by Parse()
Definition: selector.h:83
Selector yStep
BR adjustments.
Definition: selector.h:72
reg_t readSelector(SegManager *segMan, reg_t object, Selector selectorId)
Selector max
Used by EditControl, removed in SCI3.
Definition: selector.h:58
Selector cantBeHere
Checks for movement avoidance in SCI1+. Replaces canBeHere.
Definition: selector.h:110
Selector elements
Used by SetSynonyms()
Definition: selector.h:51
Selector lsRight
Used by Animate() subfunctions and scroll list controls.
Definition: selector.h:45
Selector dataInc
Used to sync music with animations, removed in SCI3.
Definition: selector.h:99
Selector vanishingX
SCI1.1 view scaling, used by global scaling.
Definition: selector.h:123
Selector play
Play function (first function to be called)
Definition: selector.h:64
Definition: vm_types.h:39
Selector brRight
Bounding Rectangle.
Definition: selector.h:48
Selector signal
Used by Animate() to control a view&#39;s behavior.
Definition: selector.h:46
Selector moveDone
used for DoBresen
Definition: selector.h:107
Selector nsRight
View boundaries (&#39;now seen&#39;)
Definition: selector.h:44
Selector printLang
Used for i18n.
Definition: selector.h:94