2007-07-29 16:31:29 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2008-01-05 12:45:14 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2007-07-29 16:31:29 +00:00
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2008-05-11 22:32:37 +00:00
|
|
|
#ifndef KYRA_SCREEN_LOK_H
|
|
|
|
#define KYRA_SCREEN_LOK_H
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-07-29 16:31:29 +00:00
|
|
|
#include "kyra/screen.h"
|
|
|
|
|
|
|
|
namespace Kyra {
|
|
|
|
|
2008-05-11 22:32:37 +00:00
|
|
|
class KyraEngine_LoK;
|
2007-07-29 16:31:29 +00:00
|
|
|
|
2008-05-11 22:32:37 +00:00
|
|
|
class Screen_LoK : public Screen {
|
2007-07-29 16:31:29 +00:00
|
|
|
public:
|
2008-05-11 22:32:37 +00:00
|
|
|
Screen_LoK(KyraEngine_LoK *vm, OSystem *system);
|
|
|
|
virtual ~Screen_LoK();
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2008-04-12 23:17:21 +00:00
|
|
|
bool init();
|
|
|
|
|
|
|
|
int getRectSize(int w, int h);
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-04-12 23:17:21 +00:00
|
|
|
void setScreenDim(int dim);
|
|
|
|
const ScreenDim *getScreenDim(int dim);
|
2010-10-23 16:01:40 +00:00
|
|
|
int screenDimTableCount() const { return _screenDimTableCount; }
|
2008-04-12 23:17:21 +00:00
|
|
|
|
|
|
|
void setTextColorMap(const uint8 *cmap);
|
|
|
|
|
2007-07-29 16:31:29 +00:00
|
|
|
void fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime);
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2008-04-12 23:17:21 +00:00
|
|
|
void savePageToDisk(const char *file, int page);
|
|
|
|
void loadPageFromDisk(const char *file, int page);
|
2008-08-20 14:03:34 +00:00
|
|
|
void queryPageFromDisk(const char *file, int page, uint8 *buffer);
|
2008-04-12 23:17:21 +00:00
|
|
|
void deletePageFromDisk(int page);
|
|
|
|
|
|
|
|
void copyBackgroundBlock(int x, int page, int flag);
|
|
|
|
void copyBackgroundBlock2(int x);
|
|
|
|
|
|
|
|
void addBitBlitRect(int x, int y, int w, int h);
|
|
|
|
void bitBlitRects();
|
|
|
|
|
2009-08-10 01:34:14 +00:00
|
|
|
// AMIGA specific
|
|
|
|
virtual void postProcessCursor(uint8 *data, int width, int height, int pitch);
|
|
|
|
|
2007-07-29 16:31:29 +00:00
|
|
|
protected:
|
2009-04-11 12:44:27 +00:00
|
|
|
enum {
|
|
|
|
kNumBitBlitRects = 10
|
|
|
|
};
|
|
|
|
|
2008-05-11 22:32:37 +00:00
|
|
|
KyraEngine_LoK *_vm;
|
2008-04-12 23:17:21 +00:00
|
|
|
|
|
|
|
static const ScreenDim _screenDimTable[];
|
|
|
|
static const int _screenDimTableCount;
|
|
|
|
|
2009-04-11 12:44:27 +00:00
|
|
|
Common::Rect _bitBlitRects[kNumBitBlitRects];
|
2008-04-12 23:17:21 +00:00
|
|
|
int _bitBlitNum;
|
|
|
|
uint8 *_unkPtr1, *_unkPtr2;
|
|
|
|
|
|
|
|
uint8 *_saveLoadPage[8];
|
|
|
|
uint8 *_saveLoadPageOvl[8];
|
2007-07-29 16:31:29 +00:00
|
|
|
};
|
|
|
|
|
2009-06-25 01:29:14 +00:00
|
|
|
class Screen_LoK_16 : public Screen_LoK {
|
|
|
|
public:
|
|
|
|
Screen_LoK_16(KyraEngine_LoK *vm, OSystem *system);
|
|
|
|
|
|
|
|
void setScreenPalette(const Palette &pal);
|
2009-06-25 01:29:27 +00:00
|
|
|
|
2009-06-25 01:29:41 +00:00
|
|
|
void fadePalette(const Palette &pal, int delay, const UpdateFunctor *upFunc = 0);
|
|
|
|
void getFadeParams(const Palette &pal, int delay, int &delayInc, int &diff);
|
|
|
|
int fadePalStep(const Palette &pal, int diff);
|
2009-06-25 01:29:14 +00:00
|
|
|
private:
|
|
|
|
void updateDirtyRectsOvl();
|
|
|
|
|
2009-06-25 01:29:27 +00:00
|
|
|
void convertTo16Colors(uint8 *page, int w, int h, int pitch, int keyColor = -1);
|
2009-06-29 18:00:18 +00:00
|
|
|
void postProcessCursor(uint8 *data, int width, int height, int pitch) {
|
2009-06-29 18:49:17 +00:00
|
|
|
convertTo16Colors(data, width, height, pitch, _cursorColorKey);
|
2009-06-29 18:00:18 +00:00
|
|
|
}
|
2009-06-25 01:29:14 +00:00
|
|
|
void mergeOverlay(int x, int y, int w, int h);
|
|
|
|
|
2009-06-25 01:29:41 +00:00
|
|
|
void set16ColorPalette(const uint8 *pal);
|
|
|
|
|
2009-06-25 01:29:14 +00:00
|
|
|
void paletteMap(uint8 idx, int r, int g, int b);
|
2009-06-25 15:53:21 +00:00
|
|
|
|
|
|
|
struct PaletteDither {
|
|
|
|
uint8 bestMatch;
|
|
|
|
uint8 invertMatch;
|
|
|
|
};
|
|
|
|
|
|
|
|
PaletteDither _paletteDither[256];
|
2009-06-25 01:29:14 +00:00
|
|
|
|
|
|
|
static const uint8 _palette16[48];
|
|
|
|
};
|
|
|
|
|
2009-10-04 21:26:33 +00:00
|
|
|
} // End of namespace Kyra
|
2007-07-29 16:31:29 +00:00
|
|
|
|
|
|
|
#endif
|