scummvm/engines/sky/text.h

113 lines
3.2 KiB
C
Raw Normal View History

/* 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.
2003-04-07 20:44:16 +00:00
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2003-04-07 20:44:16 +00:00
*
* $URL$
* $Id$
2003-04-07 20:44:16 +00:00
*
*/
#ifndef SKY_TEXT_H
#define SKY_TEXT_H
2003-04-07 20:44:16 +00:00
#include "common/scummsys.h"
namespace Sky {
struct Compact;
class Disk;
class SkyCompact;
2003-04-07 20:44:16 +00:00
struct HuffTree {
unsigned char lChild;
unsigned char rChild;
unsigned char value;
};
#define NUM_PATCH_MSG 9
struct PatchMessage {
uint32 textNr;
char text[100];
};
class Text {
2003-04-07 20:44:16 +00:00
public:
Text(Disk *skyDisk, SkyCompact *skyCompact);
~Text();
2009-03-06 00:41:46 +00:00
struct DisplayedText displayText(uint32 textNum, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
struct DisplayedText displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
struct DisplayedText lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre);
2003-05-26 13:28:43 +00:00
void fnSetFont(uint32 fontNr);
void fnTextModule(uint32 textInfoId, uint32 textNo);
void fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY);
void logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY);
2011-04-14 12:12:27 +00:00
void changeTextSpriteColor(uint8 *sprData, uint8 newCol);
uint32 giveCurrentCharSet();
uint32 _numLetters; //no of chars in message
2003-04-07 20:44:16 +00:00
private:
void initHuffTree();
void getText(uint32 textNr);
char getTextChar(uint8 **data, uint32 *bitPos);
bool getTextBit(uint8 **data, uint32 *bitPos);
void makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&data, uint8 color, uint16 bufPitch);
bool patchMessage(uint32 textNum);
2003-04-07 20:44:16 +00:00
Disk *_skyDisk;
SkyCompact *_skyCompact;
2003-04-07 20:44:16 +00:00
const HuffTree *_huffTree;
2003-04-07 20:44:16 +00:00
struct charSet {
uint8 *addr;
uint32 charHeight;
uint32 charSpacing;
} _mainCharacterSet, _linkCharacterSet, _controlCharacterSet;
2003-11-08 20:27:27 +00:00
2003-04-07 20:44:16 +00:00
uint32 _curCharSet;
uint8 *_characterSet;
2003-04-20 15:51:29 +00:00
uint8 _charHeight;
2003-04-07 20:44:16 +00:00
2003-04-20 15:51:29 +00:00
char _textBuffer[1024];
2003-11-07 02:31:44 +00:00
uint32 _dtCharSpacing; //character separation adjustment
uint32 _mouseOfsX, _mouseOfsY;
static const PatchMessage _patchedMessages[NUM_PATCH_MSG];
static const uint16 _patchLangIdx[8];
static const uint16 _patchLangNum[8];
2003-05-30 13:47:33 +00:00
static const HuffTree _huffTree_00109[]; // trees moved to hufftext.cpp
static const HuffTree _huffTree_00267[];
static const HuffTree _huffTree_00288[];
static const HuffTree _huffTree_00303[];
static const HuffTree _huffTree_00331[];
static const HuffTree _huffTree_00348[];
static const HuffTree _huffTree_00365[];
static const HuffTree _huffTree_00368[];
static const HuffTree _huffTree_00372[];
2003-04-07 20:44:16 +00:00
};
} // End of namespace Sky
2003-04-07 20:44:16 +00:00
#endif