24 #ifndef SWORD2_MAKETEXT_H 25 #define SWORD2_MAKETEXT_H 27 #include "sword2/debug.h" 34 #define BORDER_PEN 194 39 #define MAX_text_blocs MAX_DEBUG_TEXTS + 1 46 POSITION_AT_CENTER_OF_BASE = 1,
47 POSITION_AT_CENTER_OF_TOP = 2,
48 POSITION_AT_LEFT_OF_TOP = 3,
49 POSITION_AT_RIGHT_OF_TOP = 4,
50 POSITION_AT_LEFT_OF_BASE = 5,
51 POSITION_AT_RIGHT_OF_BASE = 6,
52 POSITION_AT_LEFT_OF_CENTER = 7,
53 POSITION_AT_RIGHT_OF_CENTER = 8,
54 POSITION_AT_CENTER_OF_CENTER = 9
96 static const int kChineseWidth = 20;
97 static const int kChineseHeight = 26;
99 byte bitmap[kChineseWidth * kChineseHeight];
103 uint16 analyzeSentence(
const byte *sentence, uint16 maxWidth, uint32 fontRes,
LineInfo *line,
bool isChinese);
104 byte *buildTextSprite(
const byte *sentence, uint32 fontRes, uint8 pen,
LineInfo *line, uint16 noOfLines,
bool isChinese);
105 uint16 charWidth(byte ch, uint32 fontRes);
106 uint16 wcharWidth(byte hi, byte lo, uint32 fontRes);
107 uint16 charHeight(uint32 fontRes);
108 byte *findChar(byte ch, byte *charSet);
109 byte *findWChar(byte hi, byte lo, byte *charSet);
110 void copyChar(
const byte *charPtr, byte *spritePtr, uint16 spriteWidth, uint8 pen);
111 void copyWChar(
const byte *charPtr, byte *spritePtr, uint16 spriteWidth, uint8 pen);
112 void copyCharRaw(
const byte *source, uint16 charWidth, uint16 charHeight, byte *spritePtr, uint16 spriteWidth, uint8 pen);
113 bool isKoreanChar(
const byte hi,
const byte lo,
const uint32 fontRes);
117 for (
int i = 0; i < MAX_text_blocs; i++)
118 _blocList[i].text_mem =
nullptr;
122 for (
int i = 0; i < MAX_text_blocs; i++)
123 free(_blocList[i].text_mem);
126 byte *makeTextSprite(
const byte *sentence, uint16 maxWidth, uint8 pen, uint32 fontRes, uint8 border = BORDER_PEN);
128 void killTextBloc(uint32 bloc_number);
129 void printTextBlocs();
131 uint32 buildNewBloc(byte *ascii, int16 x, int16 y, uint16 width, uint8 pen, uint32 type, uint32 fontRes, uint8 justification);
133 void loadTranslations();
Definition: maketext.h:74
Definition: animation.h:37
Definition: maketext.h:65
Definition: maketext.h:80