ScummVM API documentation
remora.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  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_REMORA_H_INCLUDED
28 #define ICB_REMORA_H_INCLUDED
29 
30 // Include headers needed by this class.
31 #include "engines/icb/common/px_string.h"
32 #include "engines/icb/common/px_common.h"
33 #include "engines/icb/common/px_bitmap.h"
34 #include "engines/icb/common/px_mapfile.h"
35 #include "engines/icb/p4.h"
36 #include "engines/icb/debug.h"
37 #include "engines/icb/player.h"
38 #include "engines/icb/global_objects.h"
39 #include "engines/icb/remora_sprite.h"
40 #include "engines/icb/icon_list_manager.h"
41 
42 namespace ICB {
43 
44 // This definition works because the PC and PSX have their own definitions of SCREEN_WIDTH and SCREEN_DEPTH.
45 #define REMORA_SCREEN_WIDTH SCREEN_WIDTH
46 #define REMORA_SCREEN_HEIGHT SCREEN_DEPTH
47 
48 // The maximum number of megas the remora will do brightness scaling for the radar sweep.
49 // Note, it needs to be multiple of 4 to get DWORD alignment
50 #define REMORA_MAX_NUMBER_OBJECTS ((MAX_session_objects + 3) & ~3)
51 
52 #define REMORA_LOG "remora_log.txt"
53 
54 // This is what the Remora MUST be called in the session.
55 #define REMORA_NAME "remora"
56 
57 // Resource names.
58 #define REMORA_BITMAP_REMORA "remora" // This is the casing for the Remora, with a hole where the screen is.
59 
60 // PC's blips have all been renamed. The PSX might continue using just this one thoug, 'cos it
61 // can do its own colouring.
62 #if defined(_PSX)
63 #define REMORA_BITMAP_SCREEN "screen" // This is the screen that fills the hole that swallowed the spider ...
64 #define REMORA_FLIC_BLIP "blip"
65 #endif
66 
67 // This is used as a constant to indicate the Remora is not active.
68 #define REMORA_NOT_ACTIVE (-1)
69 
70 // This is the default activation mode.
71 #define REMORA_DEFAULT_MODE MOTION_SCAN
72 
73 // This defines a buffer size for unpacking and formatting all that goes on the screen.
74 #define REMORA_TEXT_BUFFER_WIDTH 61 // CHECK PSX PADDING BEFORE CHANGING THIS!
75 #define REMORA_TEXT_BUFFER_ROWS MAX_LINES
76 
77 // These constants are used by the motion scanner.
78 #define REMORA_SCAN_PAN_STEP (FLOAT_ONE / 200)
79 #define REMORA_SCAN_START_ZOOM 200
80 #define REMORA_SCAN_ZOOM_HARD_UPPER 512
81 #define REMORA_SCAN_ZOOM_HARD_LOWER 100
82 #define REMORA_SCAN_ZOOM_STEP 7
83 
84 // This defines the maximum menu depth in the menu tree modes.
85 #define REMORA_MENU_DEPTH 5
86 
87 // This is the name pattern for the variables that control the Remora's menus.
88 #define REMORA_MENU_LEVEL_NAME "menu_level_*"
89 
90 // These are text attributes for the text displayed on the Remora's screen.
91 #define REMORA_TEXT_FLASH ((uint8)0x80)
92 #define REMORA_TEXT_PICTURE ((uint8)0x40)
93 #define REMORA_TEXT_HEADING ((uint8)0x01)
94 #define REMORA_TEXT_WARNING ((uint8)0x02)
95 #define REMORA_TEXT_OPTION ((uint8)0x04)
96 #define REMORA_TEXT_PARAGRAPH ((uint8)0x08)
97 
98 // This is the first line that is drawn (skipping the heading, which doesn't scroll).
99 #define REMORA_FIRST_SCROLLING_LINE 1
100 
101 // This controls how int32 the screen flash effect lasts.
102 #define REMORA_FLASH_EFFECT_LENGTH 6
103 
104 // This controls the rate at which flashing text flashes.
105 #define REMORA_TEXT_FLASH_RATE 8
106 
107 // And this controls how int32 it flashes for.
108 #define REMORA_TEXT_FLASH_DURATION 4
109 
110 // These are for the one-off interface in Mission 08.
111 #define REMORA_M08_NUM_LOCKS 12
112 #define REMORA_M08_ZOOM_X 120
113 #define REMORA_M08_ZOOM_Z 100
114 #define REMORA_M08_X_ORIGIN (-800)
115 #define REMORA_M08_Z_ORIGIN 2680
116 
117 // We can probably dispense with these and just draw one blip in different colours.
118 #define REMORA_FLIC_REMORA_BLIP "blip_green"
119 #define REMORA_FLIC_ALIVE_ROBOT_BLIP "blip_orange"
120 #define REMORA_FLIC_DEAD_ROBOT_BLIP "blip_dark_orange"
121 #define REMORA_FLIC_ALIVE_HUMAN_BLIP "blip_red"
122 #define REMORA_FLIC_DEAD_HUMAN_BLIP "blip_dark_red"
123 #define REMORA_FLIC_RECHARGE_BLIP "blip_dark_yellow"
124 
125 // This is the maximum floor ranges that can be set in any one session (probably only one will ever be set).
126 #define REMORA_MAX_FLOOR_RANGES 3
127 
128 // This is the maximum levels that can be included in scanning.
129 #define REMORA_MAX_INCLUDED_SLICES 4
130 
131 // Maximum knowledge level in the Remora maps.
132 #define REMORA_KNOWLEDGE_MAX_LEVEL 3
133 
134 // This is the maximum length of an email ID string.
135 #define REMORA_MAXLEN_EMAIL_ID_STRING 11
136 
137 #define REMORA_SCROLL_CYCLES 4
138 
139 // Holds information about a single line on the Remora's display.
140 struct _remora_line {
141  union _pos {
142  _pin_position s_ePinPosition;
143  uint32 s_nXOffset;
144 
145  } s_uPos;
146 
147  uint8 s_nAttribute;
148 
149  union _xy {
150  uint8 s_nIndent;
151  uint8 s_nPictureRow;
152 
153  } s_uXY;
154 
155  char s_pcText[REMORA_TEXT_BUFFER_WIDTH];
156 };
157 
158 // Holds a floor range. All floors within this range are displayed together in the scan modes.
159 struct _slice_range {
160  uint8 s_nLower;
161  uint8 s_nUpper;
162  uint8 s_nPad1;
163  uint8 s_nPad2;
164 };
165 
166 // Class which provides all the Remora functions for the game.
167 class _remora {
168 public:
169  // Definitions visible outside the class.
170  enum RemoraMode { UNUSED_MAIN_MENU = 0, MOTION_SCAN, INFRA_RED_LINK, DATABASE, COMMUNICATIONS, MAP, M08_LOCK_CONTROL, NO_OVERRIDE = 999 };
171 
172  enum MenuVariableAccessMode { GET = 0, SET };
173 
174  enum ScreenSymbol {
175  DO_NOT_DISPLAY = 0,
176  SS_REMORA = 1,
177  ALIVE_ROBOT = 2,
178  DEAD_ROBOT = 3,
179  ALIVE_HUMAN = 4,
180  DEAD_HUMAN = 5,
181  RECHARGE_ARMED = 6,
182  RECHARGE_UNARMED = 7,
183  DOOR_OPEN = 8,
184  DOOR_CLOSED = 9
185  };
186 
187  enum TextScroll { SCROLL_NONE = 0, SCROLL_UP, SCROLL_DOWN };
188 
189  // Default constructor and destructor.
190  _remora();
191  inline ~_remora();
192 
193  // Call this before using the Remora.
194  void InitialiseRemora();
195 
196  // Call this to activate the Remora in a given mode.
197  void ActivateRemora(RemoraMode eMode);
198 
199  // These are used to set a specific activation mode from script.
200  void SetModeOverride(RemoraMode eMode) { m_eModeOverride = eMode; }
201  void SetDefaultOrOverrideMode();
202 
203  // And call this to deactivate it.
204  void DeactivateRemora(bool8 bForceShutdown);
205 
206  // This is the main Remora call, which should get made every logic cycle (though it won't always do anything).
207  void CycleRemoraLogic(const _input &sKeyboardState);
208 
209  // This draws the Remora in its current state.
210  void DrawRemora();
211 
212  // This finds text from a reference in the Remora's compiled text files.
213  const char *LocateTextFromReference(uint32 nHashRef);
214 
215  // These functions save and restore necessary parts of the Remora.
216  void Save(Common::WriteStream *stream) const;
217  void Restore(Common::SeekableReadStream *stream);
218 
219  // This allows the script variables to be set from the engine that control the Remora's menus.
220  void AccessMenuLevelVariables(int32 *pnParams, MenuVariableAccessMode eRetrieve);
221 
222  // These draw the text used in the Remora. These are now shared between the PC and PSX.
223  void DrawScreenText();
224  void DrawVoiceOverText() const;
225 
226  // This draws a flashing message if there is an email waiting.
227  void DrawEmailWaiting();
228 
229  // This toggles the PC's formatting of text between normal mode and PSX emulation.
230  void ToggleTextFormattingPlatform() { m_bFormatForPSX = (m_bFormatForPSX == FALSE8) ? TRUE8 : FALSE8; }
231  bool8 FormatForPSX() const { return (m_bFormatForPSX); }
232  uint32 GetRemoraSurfaceId() { return (m_nRemoraSurfaceID); }
233 
234  // This is public so prim route builder can access it.
235  bool8 CohenSutherland(DXrect oRect, int32 &nX1, int32 &nY1, int32 &nX2, int32 &nY2, bool8 bnClip) const;
236 
237  // These functions have script counterparts.
238  bool8 IsActive() const { return ((m_eGameState == INACTIVE) ? FALSE8 : TRUE8); }
239  RemoraMode GetMode() const { return m_eCurrentMode; }
240  void SetMode(RemoraMode eMode);
241  void SetText(const char *pcText, uint8 nAttribute, uint8 nIndent, _pin_position ePosition);
242  void DrawHeadingText();
243  void SetupPicture(uint32 nPixelOffset, const char *pcPictureName);
244  void ClearAllText();
245  void DisplayCharacterSpeech(uint32 nHash);
246  inline void SetMaximumZoom(uint32 nZoom);
247  inline void SetMinimumZoom(uint32 nZoom);
248  void SetCurrentZoom(uint32 nZoom);
249  void NewEmail(const char *pcEmailID);
250  bool8 IsEmailWaiting() const { return ((strlen(m_pcEmailID) > 0) ? TRUE8 : FALSE8); }
251  bool8 IsThisEmailWaiting(const char *pcEmailID) const;
252  inline void MarkEmailRead();
253  void AddFloorRange(uint32 nLower, uint32 nUpper);
254  inline void ResetFloorRanges();
255  bool8 EMPEffect();
256 
257  // One of the fn_routines() needs access to the speech timer so it knows when to allow script to run on.
258  uint32 GetSpeechTimer() const { return (m_nSpeechTimer); }
259 
260  int32 GetProgressBarValue() { return m_nProgressBarValue; }
261  void SetProgressBarValue(int32 v) { m_nProgressBarValue = v; }
262 
263  int32 GetProgressBarTotal() { return m_nProgressBarTotal; }
264  void SetProgressBarTotal(int32 t) { m_nProgressBarTotal = t; }
265  void DrawProgressBar();
266 
267 private:
268  // Private definitions used internally by this class.
269  enum RemoraGameState { INACTIVE = 0, SWITCHING_ON, ACTIVE, SWITCHING_OFF };
270 
271  enum Outcode { OUTCODE_LEFT = 0x00000001, OUTCODE_RIGHT = 0x00000002, OUTCODE_BOTTOM = 0x00000004, OUTCODE_TOP = 0x00000008 };
272 
273  RemoraGameState m_eGameState; // Current state of Remora in the game (not its internal mode).
274  RemoraMode m_eCurrentMode; // Current mode Remora is in.
275  RemoraMode m_eLastMode; // Last mode the Remora was in.
276  RemoraMode m_eModeOverride; // Used to set a mode from script.
277 
278  // General graphics.
279  DXrect m_sScreenRectangle; // The drawable area of the Remora's screen.
280  DXrect m_sBackgroundRectangle; // Actually this is the size of the whole screen.
281  DXrect m_sCasingSourceRectangle; // The rectangle to blit the casing from.
282  DXrect m_sCasingTargetRectangle; // The rectangle to blit the casing to.
283  DXrect m_sMoreUpSourceRectangle; // Source rectangle for the more-up arrow.
284  DXrect m_sMoreUpTargetRectangle; // Target rectangle for the more-up arrow.
285  DXrect m_sMoreDownSourceRectangle; // Source rectangle for the more-down arrow.
286  DXrect m_sMoreDownTargetRectangle; // Target rectangle for the more-down arrow.
287 
288  uint32 m_nCasingSurfaceID; // Surface that holds the casing.
289  uint32 m_nMoreUpSurfaceID; // Surface for the more-up arrow.
290  uint32 m_nMoreDownSurfaceID; // Surface for the more-down arrow.
291  uint32 m_nRemoraSurfaceID; // Surface to draw everything into before blitting it to the working buffer
292  char m_pcRemoraCluster[MAXLEN_CLUSTER_URL];
293  bool8 m_bFormatForPSX; // Simulate PSX text formatting when true.
294  uint32 m_nDisplayedTextRows;
295  uint32 m_nCharacterSpacing;
296  uint32 m_nRowSpacing;
297 
298 #if defined(_PSX)
299  DXrect m_sCasingTargetRectangle; // The rectangle to blit the casing to.
300  char *m_pcRemoraCluster;
301 #endif // #if defined(_PSX)
302 
303  // Data for the text display.
304  _remora_line *m_pDisplayBuffer; // Holds info about text and pictures to display.
305  TextScroll m_eTextScroll; // Text scroll direction.
306 
307  // These text buffers are for when characters speak within the Remora.
308  const char *m_pcSpeechText; // Buffer to hold character-spoken text.
309  uint32 m_nSpeechTimer; // Used to count how int32 speech has been displayed.
310 
311  // These data items are for the scanning modes.
312  _remora_sprite m_oTextPicture; // Used for drawing a picture in the text.
313 
314 #if defined(_PSX)
315  _remora_sprite m_oBlipSprite; // Holds the sprite for drawing the blips on the motion tracker.
316  _remora_sprite m_oPlayerBlipSprite; // Holds the sprite fot the player's blip.
317  _remora_sprite m_oCasing; // REMORA casing sprite
318  int32 counter;
319 #else
320  uint32 m_nScanPan; // Current position of scan beam.
321  uint32 m_nPulseHighlight; // This keeps track of the highlight in the pulse.
322 #endif
323 
324  PXfloat m_fPlayerPan; // Local player pan so we can rotate the Remora scanner.
325  int32 m_nPlayerX, m_nPlayerY, m_nPlayerZ; // Position of player (may be 'fixed' for some scan modes).
326  uint32 m_nCurrentZoom; // 128 = scale of 1.0, 1 = x(1/128), 512 = scale of x4
327  uint32 m_nMinZoom; // Minimum zoom level allowed for the Remora.
328  uint32 m_nMaxZoom; // Maximum zoom level allowed for the Remora.
329  BarrierSlice *m_pSlices[REMORA_MAX_INCLUDED_SLICES]; // Slices of barriers for player's current height.
330  uint32 m_pnSlices[REMORA_MAX_INCLUDED_SLICES]; // Index of slice player is on.
331  int32 m_nIncludedCeiling; // Top coordinate of things to include in scan modes.
332  int32 m_nIncludedFloor; // Bottom coordinate of things to include in scan modes.
333  DXrect m_nPlayerBlipTargetRectangle; // Rectangle area to draw the player blip.
334  _slice_range m_pFloorRanges[REMORA_MAX_FLOOR_RANGES]; // Holds floor ranges for displaying multiple floor levels.
335 
336  int32 m_nProgressBarValue; // 0 means not displayed
337  int32 m_nProgressBarTotal; // total of latest progress bar
338 
339  int32 m_nStartYPixelOffset; // This is the scroll offset (to smooth scrolling).
340 
341  // These are some extra definitions for the M08 lock-control interface.
342  uint32 m_pnDoorIDs[REMORA_M08_NUM_LOCKS]; // IDs of the doors in M08.
343 
344  // These data items are for the Remora's email system.
345  char m_pcEmailID[REMORA_MAXLEN_EMAIL_ID_STRING + 1]; // Have to store actual string for savegames.
346 
347  // Counter to remember when objects's are in the sweep beam
348  // so bright when in beam, after that the counter goes down
349  // so they fade away
350  uint8 m_pObjectScale[REMORA_MAX_NUMBER_OBJECTS];
351 
352  // Clustering.
353  uint32 m_nRemoraClusterHash;
354 
355  // These are here at the end to keep the data aligned.
356  bool8 m_bModeChanged; // Set to true when there is a mode change.
357  uint8 m_nNextAvailableRow; // Last line text has been written to.
358  uint8 m_nFirstLineToDraw; // Display from this point (to do scrolling).
359  bool8 m_bScrollingRequired; // Set to true when the scroll controls are needed.
360 
361  bool8 m_bMainHeadingSet; // Set to true when a screen heading has been set.
362  uint8 m_nScreenFlashCount; // Counter to work a screen flash effect.
363  uint8 m_nNumFloorRangesSet; // Number of floor ranges currently set.
364  uint8 m_nNumCurrentFloorRanges; // Number floor ranges currently included in scan.
365 
366  bool8 m_bScrolling; // Set to true while text is scrolling.
367  uint8 m_nCurrentPalette; // Pointer to the current palette.
368  uint8 m_nCharacterHeight; // Used to estimate picture heights in rows of text.
369  uint8 m_nPictureHeightCorrection; // Correction to stop picture sizes being rounded down.
370 
371  uint8 m_nFlashCounter; // Counter for flashing text on and off.
372  bool8 m_bFlashingTextVisible; // Flag that goes with previous count.
373  uint8 m_bTextPictureLoaded; // Gets set to true when there is a picture in the text.
374 
375  // These are used to explicitally declare the padding in this structure to make the alignment correct.
376  // Use these variables when you add more data to the structure, so that the aligment stays correct.
377  uint8 m_nPad1;
378 
379  // Here I block the use of the default '='.
380  _remora(const _remora &) { ; }
381  void operator=(const _remora &) { ; }
382 
383  // Private functions used only by this class.
384  void DoPlatformSpecificInitialisation();
385  void SetCommonActivateInfo(RemoraMode eMode);
386  void SetUpRemora();
387  void CloseDownRemora();
388 
389  void RemoraLineDraw(int32 nX1, int32 nZ1, int32 nX2, int32 nZ2, _rgb sColour0, _rgb sColour1, uint32 nHalfThickness = 0) const;
390 
391  void InitialiseMenuControlVariables();
392 
393  void DrawGrid();
394 
395  inline const char *MakeRemoraGraphicsPath(const char *pcBitmapName) const;
396  void SetUpSurfaceForBitmap(const char *pcBitmapName, DXrect &sSourceRect, DXrect &sTargetRect, uint32 &nSurfaceID);
397  void DrawHeaderAndFooterLines();
398  void ClipTopAndBottom();
399  uint32 ComputeOutcode(DXrect oRect, int32 nX, int32 nY) const;
400  inline bool8 TestOutcode(uint32 nOutcode, Outcode enCodeToTest) const;
401 #if defined(_PSX)
402  void DrawWideScanMask(const int32 xc, const int32 yc, const int32 x1, const int32 y1, const int32 x2, const int32 y2);
403  void DrawBlip(int32 x, int32 z, _rgb sColour, uint32 size, uint32 pulse) const;
404  void InitRotMatrix(const int32 angle, const int32 zoom, const int32 x, const int32 z, int32 *dx, int32 *dz);
405 #endif
406 
407  // These functions are used by the text system.
408  uint32 GetColour(uint8 nAttribute) const { return ((uint32)(nAttribute & (uint8)0x0f)); }
409  bool8 GetFlashing(uint8 nAttribute) const { return ((bool8)((nAttribute & REMORA_TEXT_FLASH) >> 7)); }
410  void ProcessUpDownTextKeys(const _input &sKeyboardState);
411  void DrawMoreUpDownArrows();
412  void ColourToRGB(uint8 nAttributes, uint8 &nRed, uint8 &nGreen, uint8 &nBlue) const;
413  void GrabTextFormattingMemory();
414  void ReleaseTextFormattingMemory();
415 
416  // These are for the scan mode.
417  void SetUpWideScan();
418  void DrawWideScan();
419  ScreenSymbol GetSymbolToDrawObject(_logic *pObject, uint32 nID) const;
420  void DrawEMPEffect();
421  void ProcessUpDownZoomKeys(const _input &sKeyboardState);
422 
423  void DrawStaticBarriers(_rgb oLineColour) const;
424  void DrawAnimatingBarriers(_rgb oLineColour) const;
425  void DrawM08DoorLocks();
426  void DrawM08LockControlObjects();
427  void DrawFloorRectangles() const;
428 
429  void DrawObjects(void);
430  void AddInterference() const;
431  void DrawScanBeam() const;
432  void DrawPulse();
433  void DrawIRLinkPulse();
434  void DrawSquareSymbol(int32 nX, int32 nY, uint32 nPal, uint32 nSize);
435  void DrawTriangleSymbol(int32 nX, int32 nY, uint32 nPal, uint32 nSize);
436  void DrawOctagonSymbol(int32 nX, int32 nY, uint32 nPal, uint32 nSize);
437  void DrawCrosshairs() const;
438 #if defined(_PSX)
439  void DrawObjects(const int32 x1, const int32 y1, const int32 x2, const int32 y2);
440 #endif
441 
442  // These are for the one-off M08 lock control interface.
443  void SetUpM08LockControl();
444  void DrawM08LockControl();
445  void BuildM08DoorList();
446 };
447 
448 } // End of namespace ICB (to avoid nesting)
449 
450 // Here we include platform-specific definitions. The only reason we can get away with doing it here is because
451 // none of the platform-specific definitions happen to have been used in the above class definition.
452 #if defined(_PSX)
453 
454 #include "remora_psx.h"
455 
456 #define REMORA_DISPLAYED_TEXT_ROWS REMORA_PSX_DISPLAYED_TEXT_ROWS
457 #define REMORA_CHARACTER_SPACING REMORA_PSX_CHARACTER_SPACING
458 #define REMORA_ROW_SPACING REMORA_PSX_ROW_SPACING
459 
460 #else
461 
462 #include "remora_pc.h"
463 
464 #define REMORA_DISPLAYED_TEXT_ROWS m_nDisplayedTextRows
465 #define REMORA_CHARACTER_SPACING m_nCharacterSpacing
466 #define REMORA_ROW_SPACING m_nRowSpacing
467 
468 #endif
469 
470 namespace ICB {
471 
472 inline void _remora::InitialiseMenuControlVariables() {
473  int32 pnVariables[5] = {0, 0, 0, 0, 0};
474 
475  AccessMenuLevelVariables((int32 *)pnVariables, SET);
476 }
477 
478 inline void _remora::SetMaximumZoom(uint32 nZoom) {
479  // First check against the 'hard' limit.
480  if ((nZoom < REMORA_SCAN_ZOOM_HARD_LOWER) || (nZoom > REMORA_SCAN_ZOOM_HARD_UPPER))
481  Fatal_error("Zoom %d out of range %d-%d in _remora::SetMaximumZoom()", nZoom, REMORA_SCAN_ZOOM_HARD_LOWER, REMORA_SCAN_ZOOM_HARD_UPPER);
482 
483  // Maximum can't be less than minimum. If it is, we move the minimum rather than generate an error
484  // otherwise the ordering of the calls to set min and max in script will be significant.
485  m_nMinZoom = (nZoom < m_nMinZoom) ? nZoom : m_nMinZoom;
486 
487  // Now we can set the new value.
488  m_nMaxZoom = nZoom;
489 }
490 
491 inline void _remora::SetMinimumZoom(uint32 nZoom) {
492  // First check against the 'hard' limit.
493  if ((nZoom < REMORA_SCAN_ZOOM_HARD_LOWER) || (nZoom > REMORA_SCAN_ZOOM_HARD_UPPER))
494  Fatal_error("Zoom %d out of range %d-%d in _remora::SetMinimumZoom()", nZoom, REMORA_SCAN_ZOOM_HARD_LOWER, REMORA_SCAN_ZOOM_HARD_UPPER);
495 
496  // Minimum can't be greater than maximum. If it is, we move the maximum rather than generate an error
497  // otherwise the ordering of the calls to set min and max in script will be significant.
498  m_nMaxZoom = (nZoom > m_nMaxZoom) ? nZoom : m_nMaxZoom;
499 
500  // Now we can set the new value.
501  m_nMinZoom = nZoom;
502 }
503 
504 inline void _remora::NewEmail(const char *pcEmailID) { Common::strcpy_s(m_pcEmailID, pcEmailID); }
505 
506 inline void _remora::ResetFloorRanges() {
507  m_nNumFloorRangesSet = 0;
508  m_nNumCurrentFloorRanges = 0;
509 }
510 
511 inline void _remora::MarkEmailRead() {
512  m_pcEmailID[0] = '\0';
513  g_oIconMenu->ClearEmailArrived();
514 }
515 
516 extern _remora *g_oRemora;
517 
518 } // End of namespace ICB
519 
520 #endif // #if !defined( REMORA_H_INCLUDED )
Definition: remora.h:141
Definition: px_common.h:109
Definition: stream.h:77
Definition: player.h:147
Definition: px_route_barriers.h:168
Definition: actor.h:32
Definition: object_structs.h:391
Definition: remora.h:159
Definition: stream.h:745
Definition: remora.h:167
Definition: px_types.h:32
void strcpy_s(char *dst, size_t size, const char *src)
Definition: remora.h:140
Definition: remora_sprite.h:64
Definition: remora.h:149