Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JUTConsole.h
Go to the documentation of this file.
1#ifndef JUTCONSOLE_H
2#define JUTCONSOLE_H
3
7#include "__va_arg.h"
8
13class JUTConsole : public JKRDisposer {
14public:
20
22 /* 0x0 */ OUTPUT_NONE,
23 /* 0x1 */ OUTPUT_OSREPORT,
24 /* 0x2 */ OUTPUT_CONSOLE,
26 };
27
28 /* 802E73E4 */ static JUTConsole* create(unsigned int, void*, u32);
29 /* 802E7354 */ static JUTConsole* create(unsigned int, unsigned int, JKRHeap*);
30 /* 802E746C */ JUTConsole(unsigned int, unsigned int, bool);
31 /* 802E75CC */ static size_t getObjectSizeFromBufferSize(unsigned int, unsigned int);
32 /* 802E75DC */ static size_t getLineFromObjectSize(u32, unsigned int);
33 /* 802E75EC */ void clear();
34 /* 802E7648 */ void doDraw(JUTConsole::EConsoleType) const;
35 /* 802E7BB8 */ void print_f(char const*, ...);
36 /* 802E7C38 */ void print(char const*);
37 /* 802E7F7C */ void dumpToTerminal(unsigned int);
38 /* 802E80A8 */ void scroll(int);
39 /* 802E8184 */ int getUsedLine() const;
40 /* 802E81A8 */ int getLineOffset() const;
41
42 /* 802E755C */ virtual ~JUTConsole();
43
44 void setOutput(unsigned int output) { mOutput = output; }
45 void setPosition(int x, int y) {
46 mPositionX = x;
47 mPositionY = y;
48 }
50 mFontSizeX = x;
51 mFontSizeY = y;
52 }
53 void setHeight(u32 height) {
54 mHeight = height;
55 if (mHeight > mMaxLines) {
57 }
58 }
59
61 mFont = p_font;
62 setFontSize(p_font->getWidth(), p_font->getHeight());
63 }
64
65 u32 getOutput() const { return mOutput; }
66 int getPositionY() const { return mPositionY; }
67 int getPositionX() const { return mPositionX; }
68 u32 getHeight() const { return mHeight; }
69
70 bool isVisible() const { return mVisible; }
72
73 u8 getLineAttr(int param_0) { return mBuf[(field_0x20 + 2) * param_0]; }
75 u8* getLinePtr(int param_0) const { return &mBuf[(field_0x20 + 2) * param_0] + 1; }
76 int diffIndex(int param_0, int param_1) const {
77 int diff = param_1 - param_0;
78 if (diff >= 0) {
79 return diff;
80 }
81 return diff += mMaxLines;
82 }
83
84 int prevIndex(int index) const {
85 return --index < 0 ? index = mMaxLines - 1 : index;
86 }
87
88 int nextIndex(int index) const {
89 return ++index >= mMaxLines ? 0 : index;
90 }
91
94
96 /* 0x20 */ u32 field_0x20;
97 /* 0x24 */ int mMaxLines;
98 /* 0x28 */ u8* mBuf;
99 /* 0x2C */ bool field_0x2c;
100 /* 0x30 */ int field_0x30;
101 /* 0x34 */ int field_0x34;
102 /* 0x38 */ int field_0x38;
103 /* 0x3C */ int field_0x3c;
104 /* 0x40 */ int mPositionX;
105 /* 0x44 */ int mPositionY;
106 /* 0x48 */ u32 mHeight;
107 /* 0x4C */ JUTFont* mFont;
108 /* 0x50 */ f32 mFontSizeX;
109 /* 0x54 */ f32 mFontSizeY;
110 /* 0x58 */ int mOutput;
113 /* 0x64 */ int field_0x64;
114 /* 0x68 */ bool mVisible;
115 /* 0x69 */ bool field_0x69;
116 /* 0x6A */ bool field_0x6a;
117 /* 0x6B */ bool field_0x6b;
118}; // Size: 0x6C
119
125public:
126 /* 802E81CC */ JUTConsoleManager();
127 /* 802E81F4 */ static JUTConsoleManager* createManager(JKRHeap*);
128 /* 802E8240 */ void appendConsole(JUTConsole*);
129 /* 802E82B0 */ void removeConsole(JUTConsole*);
130 /* 802E8384 */ void draw() const;
131 /* 802E8450 */ void drawDirect(bool) const;
132 /* 802E84C4 */ void setDirectConsole(JUTConsole*);
133
135
137
139
141
142private:
146}; // Size: 0x14
147
148extern "C" void JUTConsole_print_f_va_(JUTConsole*, const char*, va_list);
149extern "C" void JUTSetReportConsole(JUTConsole*);
150extern "C" JUTConsole* JUTGetReportConsole();
151extern "C" void JUTSetWarningConsole(JUTConsole*);
152extern "C" JUTConsole* JUTGetWarningConsole();
153extern "C" void JUTWarningConsole_f_va(const char*, va_list);
154extern "C" void JUTReportConsole_f_va(const char*, va_list);
155extern "C" void JUTReportConsole_f(const char*, ...);
156extern "C" void JUTWarningConsole(const char* message);
157extern "C" void JUTWarningConsole_f(const char* message, ...);
158extern "C" void JUTReportConsole(const char* message);
159
160#endif /* JUTCONSOLE_H */
void JUTWarningConsole_f(const char *message,...)
Definition JUTConsole.cpp:607
void JUTSetReportConsole(JUTConsole *)
Definition JUTConsole.cpp:529
JUTConsole * JUTGetWarningConsole()
Definition JUTConsole.cpp:548
void JUTReportConsole_f(const char *,...)
Definition JUTConsole.cpp:567
void JUTWarningConsole(const char *message)
Definition JUTConsole.cpp:615
void JUTReportConsole(const char *message)
Definition JUTConsole.cpp:588
JUTConsole * JUTGetReportConsole()
Definition JUTConsole.cpp:534
void JUTReportConsole_f_va(const char *, va_list)
Definition JUTConsole.cpp:553
void JUTConsole_print_f_va_(JUTConsole *, const char *, va_list)
Definition JUTConsole.cpp:332
void JUTSetWarningConsole(JUTConsole *)
Definition JUTConsole.cpp:543
void JUTWarningConsole_f_va(const char *, va_list)
Definition JUTConsole.cpp:592
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JKRDisposer.h:12
Definition JKRHeap.h:16
Definition JUTConsole.h:124
void removeConsole(JUTConsole *)
Definition JUTConsole.cpp:452
void drawDirect(bool) const
Definition JUTConsole.cpp:496
void setDirectConsole(JUTConsole *)
Definition JUTConsole.cpp:513
JUTConsole * mDirectConsole
Definition JUTConsole.h:145
JUTConsoleManager()
Definition JUTConsole.cpp:422
JGadget::TLinkList< JUTConsole, -offsetof(JUTConsole, mListNode)> ConsoleList
Definition JUTConsole.h:140
JUTConsole * getDirectConsole() const
Definition JUTConsole.h:134
static JUTConsoleManager * sManager
Definition JUTConsole.h:138
ConsoleList soLink_
Definition JUTConsole.h:143
static JUTConsoleManager * getManager()
Definition JUTConsole.h:136
static JUTConsoleManager * createManager(JKRHeap *)
Definition JUTConsole.cpp:429
void draw() const
Definition JUTConsole.cpp:475
JUTConsole * mActiveConsole
Definition JUTConsole.h:144
void appendConsole(JUTConsole *)
Definition JUTConsole.cpp:441
Definition JUTConsole.h:13
int field_0x30
Definition JUTConsole.h:100
void scrollToFirstLine()
Definition JUTConsole.h:93
int diffIndex(int param_0, int param_1) const
Definition JUTConsole.h:76
int field_0x34
Definition JUTConsole.h:101
void clear()
Definition JUTConsole.cpp:161
int getPositionX() const
Definition JUTConsole.h:67
u32 getOutput() const
Definition JUTConsole.h:65
bool isVisible() const
Definition JUTConsole.h:70
int getUsedLine() const
Definition JUTConsole.cpp:412
void doDraw(JUTConsole::EConsoleType) const
Definition JUTConsole.cpp:176
void setLineAttr(int param_0, u8 param_1)
Definition JUTConsole.h:74
u8 * getLinePtr(int param_0) const
Definition JUTConsole.h:75
f32 mFontSizeY
Definition JUTConsole.h:109
JGadget::TLinkListNode mListNode
Definition JUTConsole.h:95
int prevIndex(int index) const
Definition JUTConsole.h:84
OutputFlag
Definition JUTConsole.h:21
@ OUTPUT_NONE
Definition JUTConsole.h:22
@ OUTPUT_OSREPORT
Definition JUTConsole.h:23
@ OUTPUT_OSR_AND_CONSOLE
Definition JUTConsole.h:25
@ OUTPUT_CONSOLE
Definition JUTConsole.h:24
bool field_0x2c
Definition JUTConsole.h:99
bool field_0x69
Definition JUTConsole.h:115
void scroll(int)
Definition JUTConsole.cpp:381
int mPositionY
Definition JUTConsole.h:105
u32 mHeight
Definition JUTConsole.h:106
u32 getHeight() const
Definition JUTConsole.h:68
bool mVisible
Definition JUTConsole.h:114
u8 * mBuf
Definition JUTConsole.h:98
int field_0x64
Definition JUTConsole.h:113
void setVisible(bool visible)
Definition JUTConsole.h:71
int nextIndex(int index) const
Definition JUTConsole.h:88
void print(char const *)
Definition JUTConsole.cpp:264
u32 field_0x20
Definition JUTConsole.h:96
static size_t getObjectSizeFromBufferSize(unsigned int, unsigned int)
Definition JUTConsole.cpp:151
virtual ~JUTConsole()
Definition JUTConsole.cpp:145
void scrollToLastLine()
Definition JUTConsole.h:92
static size_t getLineFromObjectSize(u32, unsigned int)
Definition JUTConsole.cpp:156
JUtility::TColor field_0x5c
Definition JUTConsole.h:111
u8 getLineAttr(int param_0)
Definition JUTConsole.h:73
int mOutput
Definition JUTConsole.h:110
int getLineOffset() const
Definition JUTConsole.cpp:417
void setFontSize(f32 x, f32 y)
Definition JUTConsole.h:49
int field_0x3c
Definition JUTConsole.h:103
int field_0x38
Definition JUTConsole.h:102
bool field_0x6a
Definition JUTConsole.h:116
static JUTConsole * create(unsigned int, void *, u32)
Definition JUTConsole.cpp:106
bool field_0x6b
Definition JUTConsole.h:117
int mMaxLines
Definition JUTConsole.h:97
void setHeight(u32 height)
Definition JUTConsole.h:53
void setFont(JUTFont *p_font)
Definition JUTConsole.h:60
f32 mFontSizeX
Definition JUTConsole.h:108
EConsoleType
Definition JUTConsole.h:15
@ CONSOLE_TYPE_2
Definition JUTConsole.h:18
@ CONSOLE_TYPE_0
Definition JUTConsole.h:16
@ CONSOLE_TYPE_1
Definition JUTConsole.h:17
int getPositionY() const
Definition JUTConsole.h:66
void print_f(char const *,...)
Definition JUTConsole.cpp:256
void setPosition(int x, int y)
Definition JUTConsole.h:45
int mPositionX
Definition JUTConsole.h:104
void setOutput(unsigned int output)
Definition JUTConsole.h:44
void dumpToTerminal(unsigned int)
Definition JUTConsole.cpp:339
JUTFont * mFont
Definition JUTConsole.h:107
JUtility::TColor field_0x60
Definition JUTConsole.h:112
Definition JUTFont.h:69
double x double x
Definition e_atan2.c:58
double x double y
Definition e_atan2.c:58
Definition linklist.h:7
Definition TColor.h:12
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
unsigned char u8
Definition types.h:8
static u32 message
Definition vi.c:838