22 #ifndef ASYLUM_SYSTEM_SCREEN_H 23 #define ASYLUM_SYSTEM_SCREEN_H 25 #include "common/array.h" 26 #include "common/queue.h" 27 #include "common/rect.h" 29 #include "graphics/surface.h" 31 #include "asylum/shared.h" 35 #define PALETTE_SIZE (256 * 3) 38 class GraphicResource;
43 enum GraphicItemType {
44 kGraphicItemNormal = 1,
45 kGraphicItemMasked = 5
52 ResourceId resourceId;
55 ResourceId resourceIdDestination;
63 type = kGraphicItemNormal;
64 resourceId = kResourceNone;
66 resourceIdDestination = kResourceNone;
67 flags = kDrawFlagNone;
73 ResourceId resourceId;
86 void draw(ResourceId resourceId);
87 void draw(ResourceId resourceId, uint32 frameIndex,
const Common::Point &source, DrawFlags flags = kDrawFlagNone,
bool colorKey =
true);
88 void draw(ResourceId resourceId, uint32 frameIndex,
const int16 (*srcPtr)[2], DrawFlags flags = kDrawFlagNone,
bool colorKey =
true);
89 void draw(
GraphicResource *resource, uint32 frameIndex,
const Common::Point &source, DrawFlags flags = kDrawFlagNone,
bool colorKey =
true);
90 void drawTransparent(ResourceId resourceId, uint32 frameIndex,
const Common::Point &source, DrawFlags flags, uint32 transTableNum);
92 void draw(ResourceId resourceId, uint32 frameIndex,
const Common::Point &source, DrawFlags flags, ResourceId resourceId2,
const Common::Point &destination,
bool colorKey =
true);
97 void clearDefaultColor() { memset(_mainPalette, 0, 3); setupPalette(NULL, 0, 0); }
98 void drawWideScreenBars(int16 barSize)
const;
99 void fillRect(int16 x, int16 y, int16 x2, int16 y2, uint32 color);
100 void copyBackBufferToScreen();
101 void setFlag(int16 val) { _flag = (val < -1) ? -1 : val; }
102 int16 getFlag() {
return _flag; }
105 void setPalette(ResourceId
id);
106 const byte *getPalette() {
return _mainPalette; }
107 void setMainPalette(
const byte *data);
108 void loadGrayPalette();
109 void updatePalette();
110 void updatePalette(int32 param);
111 void setupPalette(byte *buffer,
int start,
int count);
113 bool isFading() {
return _isFading; }
114 void queuePaletteFade(ResourceId resourceId, int32 ticksWait, int32 delta);
115 void paletteFade(uint32 start, int32 ticksWait, int32 delta);
116 void stopPaletteFade(
char red,
char green,
char blue);
117 void stopPaletteFadeAndSet(ResourceId
id, int32 ticksWait, int32 delta);
118 void processPaletteFadeQueue();
121 void setPaletteGamma(ResourceId
id);
122 void setGammaLevel(ResourceId
id);
125 void setupTransTable(ResourceId resourceId);
126 void setupTransTables(uint32 count, ...);
127 void selectTransTable(uint32 index);
130 void addGraphicToQueue(ResourceId resourceId, uint32 frameIndex,
const Common::Point &point, DrawFlags flags, int32 transTableNum, int32 priority);
131 void addGraphicToQueue(ResourceId resourceId, uint32 frameIndex,
const int16 (*pointPtr)[2], DrawFlags flags, int32 transTableNum, int32 priority);
132 void addGraphicToQueueCrossfade(ResourceId resourceId, uint32 frameIndex,
const Common::Point &source, int32 objectResourceId,
const Common::Point &destination, uint32 transTableNum);
133 void addGraphicToQueueMasked(ResourceId resourceId, uint32 frameIndex,
const Common::Point &source, int32 objectResourceId,
const Common::Point &destination, DrawFlags flags, int32 priority);
135 void drawGraphicsInQueue();
136 void clearGraphicsInQueue();
137 void deleteGraphicFromQueue(ResourceId resourceId);
138 bool isGraphicQueueEmpty() {
return _queueItems.empty(); }
141 void copyToBackBuffer(
const byte *buffer, int32 pitch, int16 x, int16 y, uint16 width, uint16 height,
bool mirrored =
false);
145 void drawLine(
const int16 (*srcPtr)[2],
const int16 (*dstPtr)[2], uint32 color = 0xFF);
146 void drawRect(
const Common::Rect &rect, uint32 color = 0xFF);
163 uint32 _transTableCount;
165 byte *_transTableBuffer;
166 void clearTransTables();
169 byte _currentPalette[PALETTE_SIZE];
170 byte _mainPalette[PALETTE_SIZE];
171 byte _fromPalette[PALETTE_SIZE];
172 byte _toPalette[PALETTE_SIZE];
177 byte *getPaletteData(ResourceId
id);
178 void setPaletteGamma(byte *data, byte *target = NULL);
180 void stopQueuedPaletteFade();
181 void initQueuedPaletteFade(ResourceId
id, int32 delta);
182 void runQueuedPaletteFade(ResourceId
id, int32 delta,
int i);
195 void blitTranstable (byte *dstBuffer, byte *srcBuffer, int16 height, int16 width, uint16 srcPitch, uint16 dstPitch)
const;
196 void blitTranstableMirrored(byte *dstBuffer, byte *srcBuffer, int16 height, int16 width, uint16 srcPitch, uint16 dstPitch)
const;
197 void blitMirrored (byte *dstBuffer, byte *srcBuffer, int16 height, int16 width, uint16 srcPitch, uint16 dstPitch)
const;
198 void blitMirroredColorKey (byte *dstBuffer, byte *srcBuffer, int16 height, int16 width, uint16 srcPitch, uint16 dstPitch)
const;
199 void blitRaw (byte *dstBuffer, byte *srcBuffer, int16 height, int16 width, uint16 srcPitch, uint16 dstPitch)
const;
200 void blitRawColorKey (byte *dstBuffer, byte *srcBuffer, int16 height, int16 width, uint16 srcPitch, uint16 dstPitch)
const;
201 void blitCrossfade (byte *dstBuffer, byte *srcBuffer, byte *objectBuffer, int16 height, int16 width, uint16 srcPitch, uint16 dstPitch, uint16 objectPitch)
const;
202 void bltMasked (byte *srcBuffer, byte *maskBuffer, int16 height, int16 width, uint16 srcPitch, uint16 maskPitch, byte zoom, byte *dstBuffer, uint16 dstPitch)
const;
208 void copyToBackBufferWithTransparency(byte *buffer, int32 pitch, int16 x, int16 y, uint16 width, uint16 height,
bool mirrored =
false);
211 void drawZoomedMask(byte *mask, uint16 height, uint16 width, uint16 maskPitch);
216 #endif // ASYLUM_SYSTEM_SCREEN_H
Definition: graphics.h:36
Definition: graphics.h:58