2003-10-16 13:54:48 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2003 The ScummVM project
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QUEENDISPLAY_H
|
|
|
|
#define QUEENDISPLAY_H
|
|
|
|
|
2003-12-01 20:48:41 +00:00
|
|
|
#include "common/util.h"
|
2003-10-16 13:54:48 +00:00
|
|
|
#include "queen/defs.h"
|
|
|
|
|
|
|
|
namespace Queen {
|
|
|
|
|
|
|
|
|
|
|
|
enum RenderingBuffer {
|
|
|
|
RB_BACKDROP = 0,
|
|
|
|
RB_PANEL = 1,
|
2003-12-26 14:49:49 +00:00
|
|
|
RB_SCREEN = 2,
|
|
|
|
RB_MINI = 3
|
2003-10-16 13:54:48 +00:00
|
|
|
};
|
|
|
|
|
2003-10-20 10:26:56 +00:00
|
|
|
enum JoePalette {
|
|
|
|
JP_CLOTHES = 0,
|
|
|
|
JP_DRESS = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-16 13:54:48 +00:00
|
|
|
struct Dynalum {
|
2003-10-28 15:05:35 +00:00
|
|
|
bool valid;
|
2003-10-16 13:54:48 +00:00
|
|
|
uint8 msk[50 * 160];
|
|
|
|
int8 lum[8 * 3];
|
|
|
|
uint8 prevColMask;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct TextRenderer {
|
|
|
|
void init();
|
|
|
|
void drawString(uint8 *dstBuf, uint16 dstPitch, uint16 x, uint16 y, uint8 color, const char *text, bool outlined = true);
|
|
|
|
void drawChar(uint8 *dstBuf, uint16 dstPitch, uint16 x, uint16 y, uint8 color, const uint8 *chr);
|
|
|
|
|
2003-11-24 14:18:49 +00:00
|
|
|
Language _lang;
|
|
|
|
uint8 _charWidth[256];
|
|
|
|
static const uint8 _font[];
|
2003-10-16 13:54:48 +00:00
|
|
|
};
|
|
|
|
|
2003-12-11 22:16:35 +00:00
|
|
|
class QueenEngine;
|
2003-10-16 13:54:48 +00:00
|
|
|
|
|
|
|
class Display {
|
|
|
|
public:
|
|
|
|
|
2003-12-11 22:16:35 +00:00
|
|
|
Display(QueenEngine *vm, Language language, OSystem *system);
|
2003-10-16 13:54:48 +00:00
|
|
|
~Display();
|
|
|
|
|
2003-12-11 22:16:35 +00:00
|
|
|
void dynalumInit(const char *roomName, uint16 roomNum);
|
2003-10-28 19:55:12 +00:00
|
|
|
void dynalumUpdate(int16 x, int16 y);
|
2003-10-16 13:54:48 +00:00
|
|
|
|
2003-10-16 18:57:56 +00:00
|
|
|
void palConvert(uint8 *outPal, const uint8 *inPal, int start, int end);
|
2003-10-17 13:12:50 +00:00
|
|
|
void palSet(const uint8 *pal, int start, int end, bool updateScreen = false);
|
2003-11-24 14:18:49 +00:00
|
|
|
void palSetJoe(JoePalette pal);
|
2003-11-30 20:41:02 +00:00
|
|
|
void palFadeIn(int start, int end, uint16 roomNum, bool dynalum = false, int16 dynaX = 0, int16 dynaY = 0);
|
2003-10-16 18:57:56 +00:00
|
|
|
void palFadeOut(int start, int end, uint16 roomNum);
|
2003-10-16 13:54:48 +00:00
|
|
|
void palFadePanel();
|
2003-10-17 13:12:50 +00:00
|
|
|
void palScroll(int start, int end);
|
2003-11-24 14:18:49 +00:00
|
|
|
void palCustomColors(uint16 roomNum);
|
|
|
|
void palCustomScroll(uint16 roomNum);
|
|
|
|
void palCustomFlash();
|
2003-12-03 14:09:37 +00:00
|
|
|
void palCustomLightsOff(uint16 roomNum);
|
|
|
|
void palCustomLightsOn(uint16 roomNum);
|
2003-11-24 14:18:49 +00:00
|
|
|
void palSetAllDirty() { _pal.dirtyMin = 0; _pal.dirtyMax = 255; }
|
2003-10-16 13:54:48 +00:00
|
|
|
|
|
|
|
void screenMode(int comPanel, bool inCutaway);
|
|
|
|
|
|
|
|
void prepareUpdate();
|
2003-11-30 20:41:02 +00:00
|
|
|
void update(bool dynalum = false, int16 dynaX = 0, int16 dynaY = 0);
|
2003-10-16 13:54:48 +00:00
|
|
|
|
|
|
|
void blit(RenderingBuffer dstBuf, uint16 dstX, uint16 dstY, const uint8 *srcBuf, uint16 srcW, uint16 srcH, uint16 srcPitch, bool xflip, bool masked);
|
|
|
|
void fill(RenderingBuffer dstBuf, uint16 x, uint16 y, uint16 w, uint16 h, uint8 color);
|
|
|
|
|
2003-12-26 15:36:28 +00:00
|
|
|
void readPCX(uint8 *dst, uint16 dstPitch, const uint8 *src, uint16 w, uint16 h);
|
|
|
|
void readPCXBackdrop(const uint8 *pcxBuf, uint32 size, bool useFullPal);
|
|
|
|
void readPCXPanel(const uint8 *pcxBuf, uint32 size);
|
2003-10-16 13:54:48 +00:00
|
|
|
|
2003-11-24 14:18:49 +00:00
|
|
|
void horizontalScrollUpdate(int16 xCamera);
|
2003-10-18 14:01:43 +00:00
|
|
|
void horizontalScroll(int16 scroll);
|
|
|
|
int16 horizontalScroll() const { return _horizontalScroll; }
|
2003-10-16 13:54:48 +00:00
|
|
|
|
2003-12-29 21:05:33 +00:00
|
|
|
void fullscreen(bool fs) { debug(6, "Display::fullscreen(%d)", fs); _fullscreen = fs; }
|
2003-10-16 13:54:48 +00:00
|
|
|
bool fullscreen() const { return _fullscreen; }
|
|
|
|
|
2003-10-20 20:12:59 +00:00
|
|
|
void handleTimer();
|
|
|
|
void waitForTimer();
|
|
|
|
|
2003-11-30 20:41:02 +00:00
|
|
|
void setMouseCursor(uint8 *buf, uint16 w, uint16 h, uint16 xhs, uint16 yhs);
|
|
|
|
void showMouseCursor(bool show);
|
2003-10-16 13:54:48 +00:00
|
|
|
|
2003-12-26 15:36:28 +00:00
|
|
|
uint16 textWidth(const char *text) const;
|
|
|
|
void drawText(uint16 x, uint16 y, uint8 color, const char *text, bool outlined = true);
|
2003-11-24 14:18:49 +00:00
|
|
|
void drawBox(int16 x1, int16 y1, int16 x2, int16 y2, uint8 col);
|
2003-12-26 14:49:49 +00:00
|
|
|
void drawScreen();
|
|
|
|
|
|
|
|
void blankScreen();
|
|
|
|
void blankScreenEffect1();
|
|
|
|
void blankScreenEffect2();
|
|
|
|
void blankScreenEffect3();
|
2003-11-24 14:18:49 +00:00
|
|
|
|
2003-10-16 13:54:48 +00:00
|
|
|
private:
|
|
|
|
|
2003-10-16 18:57:56 +00:00
|
|
|
enum {
|
|
|
|
FADE_SPEED = 16
|
|
|
|
};
|
|
|
|
|
2003-10-16 13:54:48 +00:00
|
|
|
enum BufferDimension {
|
|
|
|
BACKDROP_W = 640,
|
|
|
|
BACKDROP_H = 200,
|
|
|
|
SCREEN_W = 320,
|
|
|
|
SCREEN_H = 200,
|
|
|
|
PANEL_W = 320,
|
2003-12-26 14:49:49 +00:00
|
|
|
PANEL_H = 50,
|
|
|
|
MINI_W = 32,
|
|
|
|
MINI_H = 32
|
2003-10-16 13:54:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
TextRenderer _textRenderer;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint8 *room;
|
2003-10-16 18:57:56 +00:00
|
|
|
uint8 *screen;
|
2003-10-16 13:54:48 +00:00
|
|
|
int dirtyMin, dirtyMax;
|
2003-10-16 18:57:56 +00:00
|
|
|
bool scrollable;
|
2003-11-24 14:18:49 +00:00
|
|
|
} _pal;
|
2003-10-16 13:54:48 +00:00
|
|
|
|
2003-12-26 14:49:49 +00:00
|
|
|
uint8 *_buffer[4];
|
|
|
|
uint16 _bufPitch[4];
|
2003-10-16 13:54:48 +00:00
|
|
|
|
|
|
|
bool _fullscreen;
|
|
|
|
|
|
|
|
uint16 _horizontalScroll;
|
|
|
|
uint16 _bdWidth, _bdHeight;
|
|
|
|
|
2003-10-20 20:12:59 +00:00
|
|
|
bool _gotTick;
|
2003-12-26 14:49:49 +00:00
|
|
|
int _curBlankingEffect;
|
2003-10-20 20:12:59 +00:00
|
|
|
|
2003-10-16 13:54:48 +00:00
|
|
|
Dynalum _dynalum;
|
|
|
|
OSystem *_system;
|
2003-12-11 22:16:35 +00:00
|
|
|
QueenEngine *_vm;
|
2003-10-16 13:54:48 +00:00
|
|
|
|
2003-11-24 14:18:49 +00:00
|
|
|
static const uint8 _palJoeClothes[];
|
|
|
|
static const uint8 _palJoeDress[];
|
2003-10-16 13:54:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // End of namespace Queen
|
|
|
|
|
|
|
|
#endif
|