diff options
Diffstat (limited to 'include')
-rwxr-xr-x | include/game.h | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/include/game.h b/include/game.h index f713d0a..7c8b4e2 100755 --- a/include/game.h +++ b/include/game.h @@ -455,7 +455,7 @@ namespace lyt { u8 origin;
u8 flag;
- char name[0x14];
+ char name[0x11];
char userdata[8];
u8 _D5;
@@ -1157,6 +1157,78 @@ private: +namespace nw4r {
+ namespace ut {
+ class CharWriter {
+ public:
+ CharWriter();
+ ~CharWriter();
+
+ void SetupGX();
+
+ void SetFontSize(float w, float h);
+ void SetFontSize(float v);
+ float GetFontWidth() const;
+ float GetFontHeight() const;
+ float GetFontAscent() const;
+ float GetFontDescent() const;
+
+ // returns width
+ float Print(ushort character);
+
+ void PrintGlyph(float, float, float, /* nw4r::ut::Glyph const & */ void*);
+
+ void UpdateVertexColor();
+
+ private:
+ void SetupGXWithColorMapping(Color c1, Color c2);
+
+ public:
+ Color colors[8]; // todo: document
+ u32 modeOfSomeKind;
+ float scaleX;
+ float scaleY;
+ float posX;
+ float posY;
+ float posZ;
+ GXTexFilter minFilt;
+ GXTexFilter magFilt;
+ u16 completelyUnknown;
+ u8 alpha;
+ u8 isFixedWidth;
+ float fixedWidthValue;
+ /* ResFont* */ void *font;
+ };
+
+ // actually TextWriterBase<w>, but ...
+ class TextWriter : public CharWriter {
+ public:
+ TextWriter();
+ ~TextWriter();
+
+ float GetLineHeight() const;
+
+ // left out most of these to avoid all the format string vararg bullshit
+ float CalcStringWidth(wchar_t const *string, int length) const;
+
+ float Print(wchar_t const *string, int length);
+
+ float CalcLineWidth(wchar_t const *string, int length);
+
+ float GetLineSpace() const;
+
+ bool IsDrawFlagSet(ulong, ulong) const;
+
+ float _4C;
+ float charSpace;
+ float somethingRelatedToLineHeight;
+ u32 _58;
+ u32 drawFlag;
+ void *tagProcessorMaybe;
+ };
+ }
+}
+
// More layout crap
// This file REALLY needs to be reorganised.
|