ScummVM API documentation
text.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * Based on the Reverse Engineering work of Christophe Fontanel,
24 * maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
25 */
26
27#ifndef DM_TEXT_H
28#define DM_TEXT_H
29
30#include "dm/dm.h"
31#include "dm/gfx.h"
32
33namespace DM {
34
36 // Placeholder, empty for now
37}; // @ Text_Scroller
38
39#define kDMFontLetterWidth 5
40#define kDMFontLetterHeight 6
41
42class TextMan {
43 DMEngine *_vm;
44 int16 _messageAreaCursorColumn; // @ G0359_i_MessageAreaCursorColumn
45 int16 _messageAreaCursorRow; // @ G0358_i_MessageAreaCursorRow
46 int32 _messageAreaRowExpirationTime[4]; // @ G0360_al_MessageAreaRowExpirationTime
47 byte *_bitmapMessageAreaNewRow; // @ G0356_puc_Bitmap_MessageAreaNewRow
48
49 // for scrolling 'em messages
50 bool _isScrolling;
51 int64 _startedScrollingAt;
52 byte *_messageAreaCopy;
53public:
54 TextScroller _textScroller;
55
56 explicit TextMan(DMEngine *vm);
57 ~TextMan();
58
59 void printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 destX, int16 destY,
60 Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print
61 void printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen
62 void printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = kDMColorDarkestGray); // @ F0052_TEXT_PrintToViewport
63 void printWithTrailingSpaces(byte *destBitmap, int16 destByteWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
64 const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces
65 void printLineFeed(); // @ F0051_TEXT_MESSAGEAREA_PrintLineFeed
66 void printMessage(Color color, const char *string, bool printWithScroll = true); // @ F0047_TEXT_MESSAGEAREA_PrintMessage
67 void createNewRow(); // @ F0045_TEXT_MESSAGEAREA_CreateNewRow
68 void printString(Color color, const char* string);// @ F0046_TEXT_MESSAGEAREA_PrintString
69 void initialize(); // @ F0054_TEXT_Initialize
70 void moveCursor(int16 column, int16 row); // @ F0042_TEXT_MESSAGEAREA_MoveCursor
71 void clearExpiredRows(); // @ F0044_TEXT_MESSAGEAREA_ClearExpiredRows
72 void printEndGameString(int16 x, int16 y, Color textColor, const char *text); // @ F0443_STARTEND_EndgamePrintString
73 bool isTextScrolling(TextScroller *scroller, bool waitEndOfScrolling) { return false; } // @ F0561_SCROLLER_IsTextScrolling
74 void setScrollerCommand(TextScroller *scroller, int16 command) { } // @ F0560_SCROLLER_SetCommand
75 void clearAllRows(); // @ F0043_TEXT_MESSAGEAREA_ClearAllRows
76
77 void updateMessageArea();
78};
79
80}
81#endif
Definition: dm.h:169
Definition: text.h:42
Definition: text.h:35