27 #ifndef ICB_REMORA_H_INCLUDED 28 #define ICB_REMORA_H_INCLUDED 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" 45 #define REMORA_SCREEN_WIDTH SCREEN_WIDTH 46 #define REMORA_SCREEN_HEIGHT SCREEN_DEPTH 50 #define REMORA_MAX_NUMBER_OBJECTS ((MAX_session_objects + 3) & ~3) 52 #define REMORA_LOG "remora_log.txt" 55 #define REMORA_NAME "remora" 58 #define REMORA_BITMAP_REMORA "remora" // This is the casing for the Remora, with a hole where the screen is. 63 #define REMORA_BITMAP_SCREEN "screen" // This is the screen that fills the hole that swallowed the spider ... 64 #define REMORA_FLIC_BLIP "blip" 68 #define REMORA_NOT_ACTIVE (-1) 71 #define REMORA_DEFAULT_MODE MOTION_SCAN 74 #define REMORA_TEXT_BUFFER_WIDTH 61 // CHECK PSX PADDING BEFORE CHANGING THIS! 75 #define REMORA_TEXT_BUFFER_ROWS MAX_LINES 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 85 #define REMORA_MENU_DEPTH 5 88 #define REMORA_MENU_LEVEL_NAME "menu_level_*" 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) 99 #define REMORA_FIRST_SCROLLING_LINE 1 102 #define REMORA_FLASH_EFFECT_LENGTH 6 105 #define REMORA_TEXT_FLASH_RATE 8 108 #define REMORA_TEXT_FLASH_DURATION 4 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 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" 126 #define REMORA_MAX_FLOOR_RANGES 3 129 #define REMORA_MAX_INCLUDED_SLICES 4 132 #define REMORA_KNOWLEDGE_MAX_LEVEL 3 135 #define REMORA_MAXLEN_EMAIL_ID_STRING 11 137 #define REMORA_SCROLL_CYCLES 4 142 _pin_position s_ePinPosition;
155 char s_pcText[REMORA_TEXT_BUFFER_WIDTH];
170 enum RemoraMode { UNUSED_MAIN_MENU = 0, MOTION_SCAN, INFRA_RED_LINK, DATABASE, COMMUNICATIONS, MAP, M08_LOCK_CONTROL, NO_OVERRIDE = 999 };
172 enum MenuVariableAccessMode { GET = 0, SET };
182 RECHARGE_UNARMED = 7,
187 enum TextScroll { SCROLL_NONE = 0, SCROLL_UP, SCROLL_DOWN };
194 void InitialiseRemora();
197 void ActivateRemora(RemoraMode eMode);
200 void SetModeOverride(RemoraMode eMode) { m_eModeOverride = eMode; }
201 void SetDefaultOrOverrideMode();
204 void DeactivateRemora(bool8 bForceShutdown);
207 void CycleRemoraLogic(
const _input &sKeyboardState);
213 const char *LocateTextFromReference(uint32 nHashRef);
220 void AccessMenuLevelVariables(int32 *pnParams, MenuVariableAccessMode eRetrieve);
223 void DrawScreenText();
224 void DrawVoiceOverText()
const;
227 void DrawEmailWaiting();
230 void ToggleTextFormattingPlatform() { m_bFormatForPSX = (m_bFormatForPSX == FALSE8) ? TRUE8 : FALSE8; }
231 bool8 FormatForPSX()
const {
return (m_bFormatForPSX); }
232 uint32 GetRemoraSurfaceId() {
return (m_nRemoraSurfaceID); }
235 bool8 CohenSutherland(
DXrect oRect, int32 &nX1, int32 &nY1, int32 &nX2, int32 &nY2, bool8 bnClip)
const;
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);
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();
258 uint32 GetSpeechTimer()
const {
return (m_nSpeechTimer); }
260 int32 GetProgressBarValue() {
return m_nProgressBarValue; }
261 void SetProgressBarValue(int32 v) { m_nProgressBarValue = v; }
263 int32 GetProgressBarTotal() {
return m_nProgressBarTotal; }
264 void SetProgressBarTotal(int32 t) { m_nProgressBarTotal = t; }
265 void DrawProgressBar();
269 enum RemoraGameState { INACTIVE = 0, SWITCHING_ON, ACTIVE, SWITCHING_OFF };
271 enum Outcode { OUTCODE_LEFT = 0x00000001, OUTCODE_RIGHT = 0x00000002, OUTCODE_BOTTOM = 0x00000004, OUTCODE_TOP = 0x00000008 };
273 RemoraGameState m_eGameState;
274 RemoraMode m_eCurrentMode;
275 RemoraMode m_eLastMode;
276 RemoraMode m_eModeOverride;
279 DXrect m_sScreenRectangle;
280 DXrect m_sBackgroundRectangle;
281 DXrect m_sCasingSourceRectangle;
282 DXrect m_sCasingTargetRectangle;
283 DXrect m_sMoreUpSourceRectangle;
284 DXrect m_sMoreUpTargetRectangle;
285 DXrect m_sMoreDownSourceRectangle;
286 DXrect m_sMoreDownTargetRectangle;
288 uint32 m_nCasingSurfaceID;
289 uint32 m_nMoreUpSurfaceID;
290 uint32 m_nMoreDownSurfaceID;
291 uint32 m_nRemoraSurfaceID;
292 char m_pcRemoraCluster[MAXLEN_CLUSTER_URL];
293 bool8 m_bFormatForPSX;
294 uint32 m_nDisplayedTextRows;
295 uint32 m_nCharacterSpacing;
296 uint32 m_nRowSpacing;
299 DXrect m_sCasingTargetRectangle;
300 char *m_pcRemoraCluster;
301 #endif // #if defined(_PSX) 305 TextScroll m_eTextScroll;
308 const char *m_pcSpeechText;
309 uint32 m_nSpeechTimer;
321 uint32 m_nPulseHighlight;
324 PXfloat m_fPlayerPan;
325 int32 m_nPlayerX, m_nPlayerY, m_nPlayerZ;
326 uint32 m_nCurrentZoom;
330 uint32 m_pnSlices[REMORA_MAX_INCLUDED_SLICES];
331 int32 m_nIncludedCeiling;
332 int32 m_nIncludedFloor;
333 DXrect m_nPlayerBlipTargetRectangle;
336 int32 m_nProgressBarValue;
337 int32 m_nProgressBarTotal;
339 int32 m_nStartYPixelOffset;
342 uint32 m_pnDoorIDs[REMORA_M08_NUM_LOCKS];
345 char m_pcEmailID[REMORA_MAXLEN_EMAIL_ID_STRING + 1];
350 uint8 m_pObjectScale[REMORA_MAX_NUMBER_OBJECTS];
353 uint32 m_nRemoraClusterHash;
356 bool8 m_bModeChanged;
357 uint8 m_nNextAvailableRow;
358 uint8 m_nFirstLineToDraw;
359 bool8 m_bScrollingRequired;
361 bool8 m_bMainHeadingSet;
362 uint8 m_nScreenFlashCount;
363 uint8 m_nNumFloorRangesSet;
364 uint8 m_nNumCurrentFloorRanges;
367 uint8 m_nCurrentPalette;
368 uint8 m_nCharacterHeight;
369 uint8 m_nPictureHeightCorrection;
371 uint8 m_nFlashCounter;
372 bool8 m_bFlashingTextVisible;
373 uint8 m_bTextPictureLoaded;
381 void operator=(
const _remora &) { ; }
384 void DoPlatformSpecificInitialisation();
385 void SetCommonActivateInfo(RemoraMode eMode);
387 void CloseDownRemora();
389 void RemoraLineDraw(int32 nX1, int32 nZ1, int32 nX2, int32 nZ2,
_rgb sColour0,
_rgb sColour1, uint32 nHalfThickness = 0)
const;
391 void InitialiseMenuControlVariables();
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;
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);
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();
417 void SetUpWideScan();
419 ScreenSymbol GetSymbolToDrawObject(
_logic *pObject, uint32 nID)
const;
420 void DrawEMPEffect();
421 void ProcessUpDownZoomKeys(
const _input &sKeyboardState);
423 void DrawStaticBarriers(
_rgb oLineColour)
const;
424 void DrawAnimatingBarriers(
_rgb oLineColour)
const;
425 void DrawM08DoorLocks();
426 void DrawM08LockControlObjects();
427 void DrawFloorRectangles()
const;
429 void DrawObjects(
void);
430 void AddInterference()
const;
431 void DrawScanBeam()
const;
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;
439 void DrawObjects(
const int32 x1,
const int32 y1,
const int32 x2,
const int32 y2);
443 void SetUpM08LockControl();
444 void DrawM08LockControl();
445 void BuildM08DoorList();
454 #include "remora_psx.h" 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 462 #include "remora_pc.h" 464 #define REMORA_DISPLAYED_TEXT_ROWS m_nDisplayedTextRows 465 #define REMORA_CHARACTER_SPACING m_nCharacterSpacing 466 #define REMORA_ROW_SPACING m_nRowSpacing 472 inline void _remora::InitialiseMenuControlVariables() {
473 int32 pnVariables[5] = {0, 0, 0, 0, 0};
475 AccessMenuLevelVariables((int32 *)pnVariables, SET);
478 inline void _remora::SetMaximumZoom(uint32 nZoom) {
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);
485 m_nMinZoom = (nZoom < m_nMinZoom) ? nZoom : m_nMinZoom;
491 inline void _remora::SetMinimumZoom(uint32 nZoom) {
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);
498 m_nMaxZoom = (nZoom > m_nMaxZoom) ? nZoom : m_nMaxZoom;
504 inline void _remora::NewEmail(
const char *pcEmailID) {
Common::strcpy_s(m_pcEmailID, pcEmailID); }
506 inline void _remora::ResetFloorRanges() {
507 m_nNumFloorRangesSet = 0;
508 m_nNumCurrentFloorRanges = 0;
511 inline void _remora::MarkEmailRead() {
512 m_pcEmailID[0] =
'\0';
513 g_oIconMenu->ClearEmailArrived();
520 #endif // #if !defined( REMORA_H_INCLUDED )
Definition: px_common.h:109
Definition: px_route_barriers.h:168
Definition: object_structs.h:391
Definition: px_types.h:32
void strcpy_s(char *dst, size_t size, const char *src)
Definition: remora_sprite.h:64