diff options
author | Akira Akashi <rubenru09@aol.com> | 2021-06-02 22:13:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 22:13:57 +0100 |
commit | 9d3d4a2acff67f43896e9e0dcd26e7aaeb55e3b3 (patch) | |
tree | d707aa8fead427dadbbb29b886875e6c8961bd5a /include/text.h | |
parent | a2a17a9426f16ee601ff17840b8bb7851fef7138 (diff) | |
parent | 7e32d3758e7e36d7a67a1442cdb9386f9aa18a6e (diff) |
Merge branch 'master' into 0202A1E0
Diffstat (limited to 'include/text.h')
-rw-r--r-- | include/text.h | 86 |
1 files changed, 50 insertions, 36 deletions
diff --git a/include/text.h b/include/text.h index 40f4d03a..c9984d75 100644 --- a/include/text.h +++ b/include/text.h @@ -2,52 +2,66 @@ #define POKEDIAMOND_TEXT_H #include "global.h" +#include "font.h" +#include "unk_02016B94.h" + + +#define CHAR_0 0x00A2 +#define CHAR_1 0x00A3 +#define CHAR_2 0x00A4 +#define CHAR_3 0x00A5 +#define CHAR_4 0x00A6 +#define CHAR_5 0x00A7 +#define CHAR_6 0x00A8 +#define CHAR_7 0x00A9 +#define CHAR_8 0x00AA +#define CHAR_9 0x00AB + +union StrbufForPrint +{ + struct String * wrapped; + const u16 * raw; +}; 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 - }; + union StrbufForPrint currentChar; // 0 + struct Window * window; // 4 + u8 padding[1]; // 8 + u8 fontId; // 9 + u8 x; // a + u8 y; // b + u8 currentX; // c + u8 currentY; // d + u8 letterSpacing; // e + u8 lineSpacing; // f + u8 unk; // 10 + u8 fgColor; // 11 + u8 bgColor; // 12 + u8 shadowColor; // 13 + u16 unk2; // 14 + u8 unk3; // 16 + u8 unk4; // 17 }; struct TextPrinter { struct TextPrinterTemplate printerTemplate; - u8 (*callback)(struct TextPrinterTemplate *, u16); // 0x10 + u8 (*callback)(struct TextPrinterTemplate *, u16); // 0x18 u8 subStructFields[7]; // always cast to struct TextPrinterSubStruct... so why bother - u8 active; - u8 state; // 0x1C - u8 textSpeedBottom:7; + // 1c + u8 active; // 23 + u8 state; // 0x24 + u8 textSpeedBottom:7; // 25 u8 textSpeedTop:1; - u8 delayCounter; - u8 scrollDistance; - u8 minLetterSpacing; // 0x20 + u8 delayCounter; // 26 + u8 scrollDistance; // 27 + u8 minLetterSpacing; // 0x28 u8 Unk29; // used to be japanese, not sure about that anymore u16 Unk2A; - void *Unk2C; + u16 *Unk2C; }; struct FontInfo @@ -69,16 +83,16 @@ 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 AddTextPrinterParameterized(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, struct String *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); +u16 *FUN_0201C1B0(void); void FUN_0201C1EC(struct TextPrinter *printer, u32 param1, u32 param2, u32 param3); void FUN_0201C238(struct TextPrinter *printer); |