2003-04-07 20:44:16 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2005-01-01 16:09:25 +00:00
|
|
|
* Copyright (C) 2003-2005 The ScummVM project
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SKYTEXT_H
|
|
|
|
#define SKYTEXT_H
|
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
|
2004-01-03 01:58:58 +00:00
|
|
|
namespace Sky {
|
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
struct Compact;
|
2004-01-03 15:57:57 +00:00
|
|
|
class Disk;
|
2004-12-15 06:48:08 +00:00
|
|
|
class SkyCompact;
|
2003-04-07 20:44:16 +00:00
|
|
|
|
2003-05-09 17:11:47 +00:00
|
|
|
struct HuffTree {
|
2003-05-12 20:50:59 +00:00
|
|
|
unsigned char lChild;
|
|
|
|
unsigned char rChild;
|
2003-07-06 21:03:39 +00:00
|
|
|
unsigned char value;
|
2003-05-09 17:11:47 +00:00
|
|
|
};
|
|
|
|
|
2005-01-06 16:10:34 +00:00
|
|
|
#define NUM_PATCH_MSG 8
|
2003-07-31 21:26:27 +00:00
|
|
|
|
|
|
|
struct PatchMessage {
|
|
|
|
uint32 textNr;
|
|
|
|
char text[100];
|
|
|
|
};
|
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
class Text {
|
2003-04-07 20:44:16 +00:00
|
|
|
public:
|
2004-12-15 06:48:08 +00:00
|
|
|
Text(Disk *skyDisk, SkyCompact *skyCompact);
|
2004-01-03 15:57:57 +00:00
|
|
|
~Text(void);
|
2003-04-29 19:52:24 +00:00
|
|
|
void getText(uint32 textNr);
|
2003-04-29 17:42:07 +00:00
|
|
|
struct displayText_t displayText(uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
|
|
|
|
struct displayText_t displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
|
2003-07-06 21:03:39 +00:00
|
|
|
void makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&data, uint8 color);
|
2003-04-29 19:52:24 +00:00
|
|
|
struct lowTextManager_t lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre);
|
2003-05-26 13:28:43 +00:00
|
|
|
void fnSetFont(uint32 fontNr);
|
2003-06-02 06:42:42 +00:00
|
|
|
void fnTextModule(uint32 textInfoId, uint32 textNo);
|
2003-06-05 18:54:26 +00:00
|
|
|
void fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY);
|
|
|
|
void logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY);
|
2003-06-09 02:33:27 +00:00
|
|
|
void changeTextSpriteColour(uint8 *sprData, uint8 newCol);
|
2003-06-27 02:54:05 +00:00
|
|
|
uint32 giveCurrentCharSet(void) { return _curCharSet; };
|
2003-04-07 20:44:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool getTBit();
|
2003-05-09 22:06:37 +00:00
|
|
|
void initHuffTree();
|
|
|
|
char getTextChar();
|
2003-07-31 02:08:00 +00:00
|
|
|
void patchChar(byte *charSetPtr, int width, int height, int c, const uint16 *data);
|
|
|
|
void patchLINCCharset();
|
2003-07-31 21:26:27 +00:00
|
|
|
bool patchMessage(uint32 textNum);
|
2003-04-07 20:44:16 +00:00
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
Disk *_skyDisk;
|
2004-12-15 06:48:08 +00:00
|
|
|
SkyCompact *_skyCompact;
|
2003-04-07 20:44:16 +00:00
|
|
|
uint8 _inputValue;
|
|
|
|
uint8 _shiftBits;
|
|
|
|
uint8 *_textItemPtr;
|
|
|
|
|
2003-05-09 22:06:37 +00:00
|
|
|
const HuffTree *_huffTree;
|
|
|
|
|
2003-04-07 20:44:16 +00:00
|
|
|
struct charSet {
|
|
|
|
uint8 *addr;
|
|
|
|
uint32 charHeight;
|
2003-04-14 17:26:42 +00:00
|
|
|
uint32 charSpacing;
|
2003-07-05 02:21:19 +00:00
|
|
|
} _mainCharacterSet, _linkCharacterSet, _controlCharacterSet;
|
2003-11-08 20:27:27 +00:00
|
|
|
|
2003-04-07 20:44:16 +00:00
|
|
|
uint32 _curCharSet;
|
2003-04-14 17:26:42 +00:00
|
|
|
uint8 *_characterSet;
|
2003-04-20 15:51:29 +00:00
|
|
|
uint8 _charHeight;
|
2003-04-07 20:44:16 +00:00
|
|
|
uint8 *_preAfterTableArea;
|
|
|
|
|
2003-04-20 15:51:29 +00:00
|
|
|
char _textBuffer[1024];
|
2003-04-14 17:26:42 +00:00
|
|
|
uint8 _centreTable[40];
|
2003-11-08 20:27:27 +00:00
|
|
|
|
2003-04-07 20:44:16 +00:00
|
|
|
uint8 *_mouseTextData; //space for the mouse text
|
2003-04-20 15:51:29 +00:00
|
|
|
uint8 _dtCol;
|
2003-04-14 17:26:42 +00:00
|
|
|
uint16 _dtLineWidth; //width of line in pixels
|
2003-04-07 20:44:16 +00:00
|
|
|
uint32 _dtLines; //no of lines to do
|
|
|
|
uint32 _dtLineSize; //size of one line in bytes
|
|
|
|
uint8 *_dtData; //address of textdata
|
2003-04-20 15:51:29 +00:00
|
|
|
char *_dtText; //pointer to text
|
2003-11-07 02:31:44 +00:00
|
|
|
uint32 _dtCharSpacing; //character separation adjustment
|
2003-04-07 20:44:16 +00:00
|
|
|
uint32 _dtWidth; //width of chars in last line (for editing (?))
|
2003-04-20 15:51:29 +00:00
|
|
|
uint32 _dtLastWidth;
|
2003-04-14 17:26:42 +00:00
|
|
|
bool _dtCentre; //set for centre text
|
2003-06-05 18:54:26 +00:00
|
|
|
uint32 _lowTextWidth, _mouseOfsX, _mouseOfsY;
|
2003-05-30 13:47:33 +00:00
|
|
|
|
2004-12-20 16:50:29 +00:00
|
|
|
#ifndef __PALM_OS__
|
2003-07-12 15:21:34 +00:00
|
|
|
static const HuffTree _huffTree_00109[]; // trees moved to hufftext.cpp
|
|
|
|
static const HuffTree _huffTree_00267[];
|
2003-07-05 02:21:19 +00:00
|
|
|
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[];
|
2004-12-20 16:50:29 +00:00
|
|
|
#else
|
|
|
|
public:
|
|
|
|
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;
|
|
|
|
protected:
|
|
|
|
#endif
|
2003-07-05 02:21:19 +00:00
|
|
|
|
2003-07-31 21:26:27 +00:00
|
|
|
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
|
|
|
public:
|
|
|
|
uint32 _dtLetters; //no of chars in message
|
2003-04-07 20:44:16 +00:00
|
|
|
};
|
|
|
|
|
2004-01-03 01:58:58 +00:00
|
|
|
} // End of namespace Sky
|
|
|
|
|
2003-04-07 20:44:16 +00:00
|
|
|
#endif
|