diff options
author | Revo <projectrevotpp@hotmail.com> | 2021-03-12 16:31:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-12 16:31:02 -0500 |
commit | 4a15dea90f9b17c2efc29bf45dce6b65c50372d3 (patch) | |
tree | ec88382ebad9f3eebd7926a2cc25cade2c922f15 /include/text.h | |
parent | 10e6f870acce9b206280bd58b18a3269ef76447b (diff) | |
parent | bc398f3c399b5211a8b8ed38702670df654c66db (diff) |
Merge pull request #328 from red031000/master
text.c
Diffstat (limited to 'include/text.h')
-rw-r--r-- | include/text.h | 81 |
1 files changed, 80 insertions, 1 deletions
diff --git a/include/text.h b/include/text.h index 8b7fe896..40f4d03a 100644 --- a/include/text.h +++ b/include/text.h @@ -1,6 +1,85 @@ #ifndef POKEDIAMOND_TEXT_H #define POKEDIAMOND_TEXT_H -void GetSpeciesNameIntoArray(u16 species, u32 heap_id, u16 * dest); +#include "global.h" + +struct TextPrinterTemplate +{ + const u16* currentChar; + u32 windowId; + u8 padding[1]; + u8 fontId; + u8 x; + u8 y; + u8 currentX; + u8 currentY; + u8 letterSpacing; + u8 lineSpacing; + u8 unk; + u8 fgColor; + u8 bgColor; + u8 shadowColor; + union + { + struct + { + u16 unk2; + u8 unk3; + u8 unk4; + }; + u32 Unk20; //todo this can't be right + }; +}; + +struct TextPrinter +{ + struct TextPrinterTemplate printerTemplate; + + u8 (*callback)(struct TextPrinterTemplate *, u16); // 0x10 + + u8 subStructFields[7]; // always cast to struct TextPrinterSubStruct... so why bother + u8 active; + u8 state; // 0x1C + u8 textSpeedBottom:7; + u8 textSpeedTop:1; + u8 delayCounter; + u8 scrollDistance; + u8 minLetterSpacing; // 0x20 + u8 Unk29; // used to be japanese, not sure about that anymore + u16 Unk2A; + void *Unk2C; +}; + +struct FontInfo +{ + u8 maxLetterWidth; + u8 maxLetterHeight; + u8 letterSpacing; + u8 lineSpacing; + u8 unk; + u8 fgColor; + u8 bgColor; + u8 shadowColor; +}; + +void SetFontsPointer(const struct FontInfo *fonts); +u8 FUN_0201BCC8(void (*func)(u32, struct TextPrinter *), struct TextPrinter *printer, u32 param2); +void FUN_0201BCFC(u32 param0); +BOOL FUN_0201BD44(u32 param0); +void FUN_0201BD5C(void); +u8 FUN_0201BD70(u32 param0); +void FUN_0201BD7C(u32 param0); +u16 AddTextPrinterParameterized(u32 windowId, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinterParameterized2(u32 windowId, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinterParameterized3(u32 windowId, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)); +void RunTextPrinter(u32 param0, struct TextPrinter *printer); +u32 RenderFont(struct TextPrinter *printer); +void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); +void DecompressGlyphTile(const u16 *src, u16 *dst); +void FUN_0201C1A8(struct TextPrinter *printer); +void *FUN_0201C1B0(void); +void FUN_0201C1EC(struct TextPrinter *printer, u32 param1, u32 param2, u32 param3); +void FUN_0201C238(struct TextPrinter *printer); #endif //POKEDIAMOND_TEXT_H |