ScummVM API documentation
font.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 #ifndef CRUISE_FONT_H
23 #define CRUISE_FONT_H
24 
25 #include "common/scummsys.h"
26 
27 namespace Cruise {
28 
29 #include "common/pack-start.h" // START STRUCT PACKING
30 
31 struct FontInfo {
32  uint32 size;
33  uint32 offset;
34  uint16 numChars;
35  int16 hSpacing;
36  int16 vSpacing;
37 } PACKED_STRUCT;
38 
39 struct FontEntry {
40  uint32 offset;
41  int16 v1;
42  int16 charHeight;
43  int16 height2;
44  int16 charWidth;
45 } PACKED_STRUCT;
46 
47 #include "common/pack-end.h" // END STRUCT PACKING
48 
49 void loadFNT(const char *fileName);
50 void initSystem();
51 void freeSystem();
52 
54 void bigEndianShortToNative(void *var);
55 void bigEndianLongToNative(void *var); // TODO: move away
56 void flipGen(void *var, int32 length);
57 
58 int32 getLineHeight(int16 charCount, const FontEntry *fontPtr, const uint8 *fontPrt_Desc); // fontProc1
59 int32 getTextLineCount(int32 rightBorder_X, int32 wordSpacingWidth, const FontEntry *fontData,
60  const char *textString);
61 void renderWord(uint8 *fontPtr_Data, uint8 *outBufferPtr,
62  int32 drawPosPixel_X, int32 heightOff, int32 height, int32 param4,
63  int32 stringRenderBufferSize, int32 width, int32 charWidth);
64 gfxEntryStruct *renderText(int inRightBorder_X, const char *string);
65 void drawString(int32 x, int32 y, const char *string, uint8 * buffer, uint8 fontColor,
66  int32 inRightBorder_X);
67 void freeGfx(gfxEntryStruct *pGfx);
68 
69 } // End of namespace Cruise
70 
71 #endif
Definition: font.h:39
Definition: actor.h:25
Definition: object.h:29
Definition: font.h:31