ScummVM API documentation
remora_pc.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_PC_H_INCLUDED
28 #define ICB_REMORA_PC_H_INCLUDED
29 
30 namespace ICB {
31 
32 #define REMORA_MAX_YS 1024
33 #define REMORA_BYTES_PER_PIXEL 4
34 
35 #define REMORA_SCREEN_ORIGIN_X (0)
36 #define REMORA_SCREEN_ORIGIN_Y (0)
37 
38 // Brightness defaults.
39 #define REMORA_BRIGHT_MIN 150
40 #define REMORA_BRIGHT_HALF 200
41 #define REMORA_BRIGHT_FULL 255
42 
43 // This controls thickness of barriers.
44 #define REMORA_LINE_FUZZ 3
45 
46 // Some text parameters.
47 #define REMORA_TEXT_LEFT_MARGIN 125
48 #define REMORA_TEXT_RIGHT_MARGIN 480
49 #define REMORA_TEXT_CENTRE ((REMORA_TEXT_RIGHT_MARGIN - REMORA_TEXT_LEFT_MARGIN) / 2 + REMORA_TEXT_LEFT_MARGIN)
50 #define REMORA_TEXT_TITLE_Y 90
51 #define REMORA_TEXT_TOP_MARGIN 115
52 #define REMORA_TEXT_BOTTOM_MARGIN 400
53 #define REMORA_TEXT_TAB_ONE 20
54 #define REMORA_DISPLAY_WIDTH 340
55 #define REMORA_SPEECH_X_POSITION (SCREEN_WIDTH / 2)
56 #define REMORA_SPEECH_Y_POSITION 10
57 #define REMORA_TEXT_CLIP_TOP 116
58 #define REMORA_TEXT_CLIP_BOTTOM 357
59 
60 // This defines the maximum height and width for a remora text picture.
61 #define REMORA_MAX_PICTURE_HEIGHT 280
62 #define REMORA_MAX_PICTURE_WIDTH 420
63 
64 // These position the email-waiting message on the screen.
65 #define REMORA_EMAIL_WAITING_X 400
66 #define REMORA_EMAIL_WAITING_Y 380
67 
68 // This defines the size and speed of the motion scan beam.
69 #define REMORA_SCAN_SPEED 4
70 #define REMORA_SCAN_WIDTH 45
71 #define REMORA_SCAN_LENGTH ((float)REMORA_SCREEN_HEIGHT)
72 
73 #define REMORA_SCREEN_CENTRE_X (REMORA_SCREEN_WIDTH / 2)
74 #define REMORA_SCREEN_CENTRE_Z (REMORA_SCREEN_HEIGHT / 2)
75 
76 // Some values for the progress bar.
77 #define REMORA_PROGRESS_BAR_WIDTH 200
78 #define REMORA_PROGRESS_BAR_HEIGHT 10
79 #define REMORA_PROGRESS_BAR_X (320 - (REMORA_PROGRESS_BAR_WIDTH / 2))
80 #define REMORA_PROGRESS_BAR_Y 231
81 
82 // Size and positioning of the background grid.
83 #define REMORA_GRID_SIZE 40
84 #define REMORA_GRID_X 39
85 #define REMORA_GRID_Y 36
86 
87 // These are for the text scrolling.
88 #define REMORA_SCROLL_AMOUNT 2 // Pixels.
89 
90 // These are the values that the PC borrows to emulate the PSX.
91 #define REMORA_PC_DISPLAYED_TEXT_ROWS 12
92 #define REMORA_PC_TEXT_ROW_SPACING 0
93 #define REMORA_PC_CHARACTER_SPACING 0
94 
95 // PC uses these values to emulate PSX text formatting.
96 #define REMORA_PSXFORMAT_DISPLAYED_ROWS 10 // Get this from remora_psx.h ( had to add 1 for some reason).
97 #define REMORA_PSXFORMAT_ROW_SPACING 16 // Guess this.
98 #define REMORA_PSXFORMAT_CHAR_SPACING 1 // Guess this.
99 
100 // These set a size for the screen drawing area, which used to come from a
101 // sprite but now doesn't.
102 #define REMORA_DRAWABLE_SCREEN_LEFT 20
103 #define REMORA_DRAWABLE_SCREEN_TOP 20
104 #define REMORA_DRAWABLE_SCREEN_WIDTH 600
105 #define REMORA_DRAWABLE_SCREEN_HEIGHT 440
106 
107 // These are the names of the bitmaps used for marking when text can scroll.
108 #define REMORA_BITMAP_MORE_UP "remora_more_up"
109 #define REMORA_BITMAP_MORE_DOWN "remora_more_down"
110 
111 // This defines the size of the symbols that get draw on the scan modes.
112 #define REMORA_SYMBOL_SIZE_NORMAL 3
113 #define REMORA_SYMBOL_SIZE_BIG 6
114 
115 // This defines a safe border for drawing the symbols (which works because the casing covers the gap).
116 #define REMORA_SYMBOL_BORDER 20
117 
118 #define REMORA_NUM_COLOUR_SCHEMES 3
119 #define REMORA_COLOURS_PER_SCHEME 25
120 extern const uint8 pnRemoraColour[REMORA_NUM_COLOUR_SCHEMES][REMORA_COLOURS_PER_SCHEME][3];
121 enum { CI_RED = 0, CI_GREEN, CI_BLUE };
122 
123 // These are drawing points for drawing the animating pulse blip and some definitions.
124 #define REMORA_PULSE_X 430
125 #define REMORA_PULSE_Y 105
126 #define REMORA_PULSE_WIDTH 40
127 #define REMORA_PULSE_POINTS 13
128 #define REMORA_MAX_HEALTH 3
129 #define REMORA_HIGHLIGHT_LENGTH 10
130 
131 #define REMORA_IRPULSE_X 435
132 #define REMORA_IRPULSE_Y 95
133 #define REMORA_IR_LINK_WIDTH 35
134 #define REMORA_IR_LINK_POINTS 9
135 
136 const int32 pnPulsePoints[REMORA_PULSE_POINTS][2] = {{0, 0}, {3, 0}, {6, 0}, {9, -5}, {12, -10}, {15, -5}, {18, 0}, {21, 5}, {24, 10}, {27, 5}, {30, 0}, {33, 0}, {36, 0}};
137 
138 const int32 pnIRLinkPoints[REMORA_IR_LINK_POINTS][2] = {{0, 0}, {5, 0}, {10, 0}, {15, 0}, {20, 0}, {25, 0}, {25, 10}, {30, 10}, {35, 10}};
139 
140 const int32 pnIRLinkPointsR[REMORA_IR_LINK_POINTS][2] = {{0, 10}, {5, 10}, {10, 10}, {10, 20}, {15, 20}, {20, 20}, {25, 20}, {30, 20}, {35, 20}};
141 
142 inline uint32 GetPen(uint8 nPalette, int32 eCI, uint8 nAlpha = 255) {
143  return ((uint32)((nAlpha << 24) | (pnRemoraColour[nPalette][eCI][CI_RED] << 16) | (pnRemoraColour[nPalette][eCI][CI_GREEN] << 8) | pnRemoraColour[nPalette][eCI][CI_BLUE]));
144 }
145 
146 inline const char *_remora::MakeRemoraGraphicsPath(const char *pcBitmapName) const {
147  static char pcRemoraGraphicsPath[MAXLEN_URL];
148 
149  Common::sprintf_s(pcRemoraGraphicsPath, REMORA_GRAPHICS_PATH);
150  Common::strcat_s(pcRemoraGraphicsPath, pcBitmapName);
151  Common::strcat_s(pcRemoraGraphicsPath, ".");
152  Common::strcat_s(pcRemoraGraphicsPath, PX_BITMAP_EXT);
153 
154  return (pcRemoraGraphicsPath);
155 }
156 
157 _remora::~_remora() {
158  if (m_pDisplayBuffer) {
159  delete[] m_pDisplayBuffer;
160  m_pDisplayBuffer = NULL;
161  }
162 }
163 
164 inline bool8 _remora::TestOutcode(uint32 nOutcode, Outcode eCodeToTest) const { return ((bool8)(nOutcode & eCodeToTest)); }
165 
166 } // End of namespace ICB
167 
168 #endif // #if !defined( REMORA_PC_H_INCLUDED )
Definition: actor.h:32
int sprintf_s(char *dst, size_t size, MSVC_PRINTF const char *format,...) GCC_PRINTF(3
void strcat_s(char *dst, size_t size, const char *src)