22 #ifndef AGI_GRAPHICS_H 23 #define AGI_GRAPHICS_H 29 #define SCRIPT_WIDTH 160 30 #define SCRIPT_HEIGHT 168 31 #define VISUAL_WIDTH 160 32 #define VISUAL_HEIGHT 200 33 #define DISPLAY_DEFAULT_WIDTH 320 34 #define DISPLAY_DEFAULT_HEIGHT 200 36 enum GfxScreenUpscaledMode {
37 DISPLAY_UPSCALED_DISABLED = 0,
38 DISPLAY_UPSCALED_640x400 = 1
44 GFX_SCREEN_MASK_VISUAL = 1,
45 GFX_SCREEN_MASK_PRIORITY = 2,
46 GFX_SCREEN_MASK_ALL = GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY
50 const byte *bitmapData;
51 byte *bitmapDataAllocated;
63 uint8 _paletteGfxMode[256 * 3];
64 uint8 _paletteTextMode[256 * 3];
66 uint8 _agipalPalette[16 * 3];
74 static void initPalette(uint8 *destPalette,
const uint8 *paletteData, uint colorCount = 16, uint fromBits = 6, uint toBits = 8);
75 static void initPaletteCLUT(uint8 *destPalette,
const uint16 *paletteCLUTData, uint colorCount = 16);
77 int getAGIPalFileNum()
const;
78 void setPalette(
bool GfxModePalette);
80 void initMouseCursor(
MouseCursorData *mouseCursor,
const byte *bitmapData, uint16 width, uint16 height,
int hotspotX,
int hotspotY);
81 void setMouseCursor(
bool busy =
false);
83 void setRenderStartOffset(uint16 offsetY);
84 uint16 getRenderStartDisplayOffsetY()
const;
86 void translateGamePosToDisplayScreen(int16 &x, int16 &y)
const;
87 void translateVisualPosToDisplayScreen(int16 &x, int16 &y)
const;
88 void translateDisplayPosToGameScreen(int16 &x, int16 &y)
const;
90 void translateVisualDimensionToDisplayScreen(int16 &width, int16 &height)
const;
91 void translateDisplayDimensionToVisualScreen(int16 &width, int16 &height)
const;
93 void translateGameRectToDisplayScreen(int16 &x, int16 &y, int16 &width, int16 &height)
const;
94 void translateVisualRectToDisplayScreen(int16 &x, int16 &y, int16 &width, int16 &height)
const;
96 uint32 getDisplayOffsetToGameScreenPos(int16 x, int16 y)
const;
97 uint32 getDisplayOffsetToVisualScreenPos(int16 x, int16 y)
const;
99 void copyDisplayRectToScreen(int16 x, int16 y, int16 width, int16 height);
100 void copyDisplayRectToScreen(int16 x, int16 adjX, int16 y, int16 adjY, int16 width, int16 adjWidth, int16 height, int16 adjHeight);
101 void copyDisplayRectToScreenUsingGamePos(int16 x, int16 y, int16 width, int16 height);
102 void copyDisplayRectToScreenUsingVisualPos(int16 x, int16 y, int16 width, int16 height);
103 void copyDisplayToScreen();
105 void translateFontPosToDisplayScreen(int16 &x, int16 &y)
const;
106 void translateDisplayPosToFontScreen(int16 &x, int16 &y)
const;
107 void translateFontDimensionToDisplayScreen(int16 &width, int16 &height)
const;
108 void translateFontRectToDisplayScreen(int16 &x, int16 &y, int16 &width, int16 &height)
const;
109 Common::Rect getFontRectForDisplayScreen(int16 column, int16 row, int16 width, int16 height)
const;
117 byte *_priorityScreen;
119 byte *_displayScreen;
121 uint16 _displayScreenWidth;
122 uint16 _displayScreenHeight;
124 uint16 _displayFontWidth;
125 uint16 _displayFontHeight;
127 uint16 _displayWidthMulAdjust;
128 uint16 _displayHeightMulAdjust;
134 GfxScreenUpscaledMode _upscaledHires;
136 bool _priorityTableSet;
137 uint8 _priorityTable[SCRIPT_HEIGHT];
142 uint16 _renderStartVisualOffsetY;
143 uint16 _renderStartDisplayOffsetY;
146 uint16 getDisplayScreenWidth()
const {
147 return _displayScreenWidth;
149 uint16 getDisplayFontWidth()
const {
150 return _displayFontWidth;
152 uint16 getDisplayFontHeight()
const {
153 return _displayFontHeight;
156 GfxScreenUpscaledMode getUpscaledHires()
const {
157 return _upscaledHires;
160 void debugShowMap(
int mapNr);
162 void clear(byte color, byte priority);
163 void clearDisplay(byte color,
bool copyToScreen =
true);
164 void putPixel(int16 x, int16 y, byte drawMask, byte color, byte priority);
165 void putPixelOnDisplay(int16 x, int16 y, byte color);
166 void putPixelOnDisplay(int16 x, int16 adjX, int16 y, int16 adjY, byte color);
167 void putFontPixelOnDisplay(int16 baseX, int16 baseY, int16 addX, int16 addY, byte color,
bool isHires);
169 byte getColor(int16 x, int16 y)
const;
170 byte getPriority(int16 x, int16 y)
const;
171 bool checkControlPixel(int16 x, int16 y, byte newPriority)
const;
173 byte getCGAMixtureColor(byte color)
const;
175 void render_Block(int16 x, int16 y, int16 width, int16 height,
bool copyToScreen =
true);
178 static bool render_Clip(int16 &x, int16 &y, int16 &width, int16 &height,
const int16 minY,
const int16 clipAgainstWidth,
const int16 clipAgainstHeight);
179 void render_BlockEGA(int16 x, int16 y, int16 width, int16 height);
180 void render_BlockCGA(int16 x, int16 y, int16 width, int16 height);
181 void render_BlockHercules(int16 x, int16 y, int16 width, int16 height);
184 void transition_Amiga();
185 void transition_AtariSt();
187 void block_save(int16 x, int16 y, int16 width, int16 height, byte *bufferPtr)
const;
188 void block_restore(int16 x, int16 y, int16 width, int16 height, byte *bufferPtr);
190 void drawBox(int16 x, int16 y, int16 width, int16 height, byte backgroundColor, byte lineColor);
191 void drawDisplayRect(int16 x, int16 y, int16 width, int16 height, byte color,
bool copyToScreen =
true);
192 void drawDisplayRect(int16 x, int16 adjX, int16 y, int16 adjY, int16 width, int16 adjWidth, int16 height, int16 adjHeight, byte color,
bool copyToScreen =
true);
194 void drawDisplayRectEGA(int16 x, int16 y, int16 width, int16 height, byte color);
195 void drawDisplayRectCGA(int16 x, int16 y, int16 width, int16 height, byte color);
198 void drawCharacter(int16 row, int16 column, byte character, byte foreground, byte background,
bool disabledLook);
199 void drawStringOnDisplay(int16 x, int16 y,
const char *text, byte foreground, byte background);
200 void drawStringOnDisplay(int16 x, int16 adjX, int16 y, int16 adjY,
const char *text, byte foregroundColor, byte backgroundColor);
201 void drawCharacterOnDisplay(int16 x, int16 y, byte character, byte foreground, byte background, byte transformXOR = 0, byte transformOR = 0);
203 void shakeScreen(int16 repeatCount);
206 void initPriorityTable();
207 static void createDefaultPriorityTable(uint8 *priorityTable);
208 void setPriorityTable(int16 priorityBase);
209 bool saveLoadWasPriorityTableModified()
const;
210 int16 saveLoadGetPriority(int16 yPos)
const;
211 void saveLoadSetPriorityTableModifiedBool(
bool wasModified);
212 void saveLoadSetPriority(int16 yPos, int16 priority);
213 void saveLoadFigureOutPriorityTableModifiedBool();
215 int16 priorityToY(int16 priority)
const;
216 int16 priorityFromY(int16 yPos)
const;
Definition: graphics.h:49
Definition: graphics.h:58