Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/Storage/Legacy/TextLegacy.hpp
1168 views
1
2
namespace Legacy
3
{
4
5
#define LEGACY_TEXTDATA_COUNT (0x2800)
6
#define LEGACY_TEXTENTRY_COUNT (0x200)
7
#define LEGACY_TEXTMENU_COUNT (0x2)
8
9
enum TextInfoTypes { TEXTINFO_TEXTDATA = 0, TEXTINFO_TEXTSIZE = 1, TEXTINFO_ROWCOUNT = 2 };
10
11
struct TextMenu {
12
uint16 textData[LEGACY_TEXTDATA_COUNT];
13
int32 entryStart[LEGACY_TEXTENTRY_COUNT];
14
int32 entrySize[LEGACY_TEXTENTRY_COUNT];
15
uint8 entryHighlight[LEGACY_TEXTENTRY_COUNT];
16
int32 textDataPos;
17
int32 selection1;
18
int32 selection2;
19
uint16 rowCount;
20
uint16 visibleRowCount;
21
uint16 visibleRowOffset;
22
uint8 alignment;
23
uint8 selectionCount;
24
int8 timer;
25
};
26
27
enum TextMenuAlignments {
28
MENU_ALIGN_LEFT,
29
MENU_ALIGN_RIGHT,
30
MENU_ALIGN_CENTER,
31
};
32
33
extern TextMenu gameMenu[LEGACY_TEXTMENU_COUNT];
34
extern int32 textMenuSurfaceNo;
35
36
void SetupTextMenu(TextMenu *menu, int32 rowCount);
37
void AddTextMenuEntry(TextMenu *menu, const char *text);
38
void SetTextMenuEntry(TextMenu *menu, const char *text, int32 rowID);
39
void EditTextMenuEntry(TextMenu *menu, const char *text, int32 rowID);
40
41
namespace v4
42
{
43
void LoadTextFile(TextMenu *menu, const char *filePath);
44
}
45
46
namespace v3
47
{
48
49
#define LEGACY_v3_FONTCHAR_COUNT (0x400)
50
51
struct FontCharacter {
52
int32 id;
53
int16 srcX;
54
int16 srcY;
55
int16 width;
56
int16 height;
57
int16 pivotX;
58
int16 pivotY;
59
int16 xAdvance;
60
};
61
62
extern FontCharacter fontCharacterList[LEGACY_v3_FONTCHAR_COUNT];
63
64
void LoadTextFile(TextMenu *menu, const char *filePath, uint8 mapCode);
65
66
void LoadFontFile(const char *filePath);
67
void DrawBitmapText(void *menu, int32 XPos, int32 YPos, int32 scale, int32 spacing, int32 rowStart, int32 rowCount);
68
} // namespace v3
69
70
} // namespace Legacy
71