diff options
author | Treeki <treeki@gmail.com> | 2011-06-20 17:36:29 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-06-20 17:36:29 +0200 |
commit | 3e67e3a91ac797791fabdf4ec730ef8d1a8f6990 (patch) | |
tree | 7f725dc75b18b579b049dbbaf552173a65cabda8 /include | |
parent | 7269f2c9ea7c817ce4975f3a8972e73884e9aaf7 (diff) | |
download | kamek-3e67e3a91ac797791fabdf4ec730ef8d1a8f6990.tar.gz kamek-3e67e3a91ac797791fabdf4ec730ef8d1a8f6990.zip |
fixed a lyt::Pane def bug, added CharWriter and TextWriter
Diffstat (limited to '')
-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.
|