22 #ifndef SWORD1_SCREEN_H 23 #define SWORD1_SCREEN_H 25 #include "sword1/sworddefs.h" 26 #include "common/mutex.h" 52 uint8 *decodedBackground;
58 #define SHRINK_BUFFER_SIZE 50000 59 #define RLE_BUFFER_SIZE 50000 63 #define BORDER_YELLOW 2 64 #define BORDER_GREEN 3 65 #define BORDER_PURPLE 4 66 #define BORDER_BLACK 5 81 void useTextManager(
Text *pTextMan);
83 void initFadePaletteServer();
86 void newScreen(uint32 screen);
88 void setScrolling(int16 offsetX, int16 offsetY);
89 void addToGraphicList(uint8 listId, uint32 objId);
91 void startFadePaletteDown(
int speed);
92 void startFadePaletteUp(
int speed);
94 void fnSetPalette(uint8 start, uint16 length, uint32
id);
95 void fnSetFadeTargetPalette(uint8 start, uint16 length, uint32
id,
int singleColor = -1);
97 void fullRefresh(
bool soft =
false);
98 void setNextFadeOutToBlack();
100 bool showScrollFrame();
102 void showFrame(uint16 x, uint16 y, uint32 resId, uint32 frameNo,
const byte *fadeMask =
nullptr, int8 fadeStatus = 0);
104 void fnSetParallax(uint32 screen, uint32 resId);
105 void fnFlash(uint8 color);
107 static void decompressHIF(uint8 *src, uint8 *dest);
109 void printDebugLine(uint8 *ascii, uint8 first,
int x,
int y);
112 void plotLine(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color);
113 void plotPoint(int32 x, int32 y, uint8 color);
114 void bresenhamLine(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color);
122 const uint8 _white[3] = { 63, 63, 63 };
123 const uint8 _red[3] = { 63 << 2, 0 << 2, 0 << 2 };
124 const uint8 _blue[3] = { 0 << 2, 0 << 2, 63 << 2 };
125 const uint8 _yellow[3] = { 63 << 2, 63 << 2, 0 << 2 };
126 const uint8 _green[3] = { 0 << 2, 63 << 2, 0 << 2 };
127 const uint8 _purple[3] = { 32 << 2, 0 << 2, 32 << 2 };
128 const uint8 _black[3] = { 0 << 2, 0 << 2, 0 << 2 };
131 struct PaletteFadeInfo {
136 uint8 srcPalette[256 * 3];
137 uint8 dstPalette[256 * 3];
140 PaletteFadeInfo _paletteFadeInfo;
142 void verticalMask(uint16 x, uint16 y, uint16 bWidth, uint16 bHeight);
143 void blitBlockClear(uint16 x, uint16 y, uint8 *data);
144 void renderParallax(uint8 *data);
145 void processImage(uint32
id);
146 void spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *sprWidth, uint16 *sprHeight, uint16 *incr);
147 void drawSprite(uint8 *sprData, uint16 sprX, uint16 sprY, uint16 sprWidth, uint16 sprHeight, uint16 sprPitch);
148 void drawPsxHalfShrinkedSprite(uint8 *sprData, uint16 sprX, uint16 sprY, uint16 sprWidth, uint16 sprHeight, uint16 sprPitch);
149 void drawPsxFullShrinkedSprite(uint8 *sprData, uint16 sprX, uint16 sprY, uint16 sprWidth, uint16 sprHeight, uint16 sprPitch);
150 uint8 *psxBackgroundToIndexed(uint8 *psxBackground, uint32 bakXres, uint32 bakYres);
151 uint8 *psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXres, uint32 bakYres);
152 void fetchPsxParallaxSize(uint8 *psxParallax, uint16 *paraSizeX, uint16 *paraSizeY);
153 void drawPsxParallax(uint8 *psxParallax, uint16 paraScrlX, uint16 scrnScrlX, uint16 scrnWidth);
154 void decompressRLE7(uint8 *src, uint32 compSize, uint8 *dest);
155 void decompressRLE0(uint8 *src, uint32 compSize, uint8 *dest);
156 void decompressTony(uint8 *src, uint32 compSize, uint8 *dest);
157 void fastShrink(uint8 *src, uint32 width, uint32 height, uint32
scale, uint8 *dest);
159 void flushPsxCache();
167 uint16 _currentScreen;
170 uint16 *_layerGrid[4];
171 uint8 *_layerBlocks[4];
173 uint8 _rleBuffer[RLE_BUFFER_SIZE];
174 uint8 _shrinkBuffer[SHRINK_BUFFER_SIZE];
177 uint16 _oldScrollX, _oldScrollY;
181 uint32 _foreList[MAX_FORE];
182 uint32 _backList[MAX_BACK];
184 uint8 _foreLength, _backLength, _sortLength;
185 uint16 _scrnSizeX, _scrnSizeY, _gridSizeX, _gridSizeY;
187 static RoomDef _roomDefTable[TOTAL_ROOMS];
189 uint8 _targetPalette[256 * 3];
190 uint8 _currentPalette[256 * 3];
191 uint8 _zeroPalette[256 * 3];
193 bool _forceNextFadeOutToBlack =
false;
Definition: animation.h:38
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: objectman.h:33