From badb2bf6bc25f47e711fc483e0c551b4fc18759f Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 21 Sep 2012 00:08:14 +0200 Subject: fixes, header cleanups, and part of the code for the new HUD --- include/game.h | 69 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/game.h b/include/game.h index 7e8456d..2dc64a6 100755 --- a/include/game.h +++ b/include/game.h @@ -505,6 +505,20 @@ namespace lyt { class Group; class GroupContainer; + namespace detail { + class TexCoordAry { + public: + TexCoordAry(); + void Free(); + void Reserve(u8 count); + void SetSize(u8 count); + void Copy(const void *source, u8 count); + + u8 reservedSize, usedSize; + void *data; + }; + } + class Layout { public: Layout(); @@ -636,11 +650,17 @@ namespace lyt { u8 flag; char name[0x11]; - char userdata[8]; + char userdata[9]; - u8 _D5; u8 paneIsOwnedBySomeoneElse; u8 _D7; + + void SetVisible(bool value) { + if (value) + flag |= 1; + else + flag &= ~1; + } }; class TextBox : public Pane { @@ -657,7 +677,7 @@ namespace lyt { uchar GetVtxColorElement(ulong id) const; void SetVtxColorElement(ulong id, uchar value); - virtual void LoadMtx(const DrawInfo &info); + void LoadMtx(const DrawInfo &info); virtual void AllocStringBuffer(u16 size); virtual void FreeStringBuffer(); @@ -681,6 +701,26 @@ namespace lyt { u8 alignment; u8 flags; }; + + class Picture : public Pane { + public: + Picture(void *, void *); // todo: Picture((res::Picture const *,ResBlockSet const &)) + ~Picture(); + + void *GetRuntimeTypeInfo() const; + + void DrawSelf(const DrawInfo &info); + + ut::Color GetVtxColor(ulong id) const; + void SetVtxColor(ulong id, ut::Color color); + uchar GetVtxColorElement(ulong id) const; + void SetVtxColorElement(ulong id, uchar value); + + virtual void Append(const GXTexObj &obj); + + ut::Color colours[4]; + detail::TexCoordAry texCoords; + }; } @@ -2482,7 +2522,10 @@ namespace nw4r { void SetupGXWithColorMapping(Color c1, Color c2); public: - Color colors[8]; // todo: document + Color minColMapping, maxColMapping; + Color vtxColours[4]; + Color topColour, bottomColour; + u32 modeOfSomeKind; float scaleX; float scaleY; @@ -2517,12 +2560,12 @@ namespace nw4r { bool IsDrawFlagSet(ulong, ulong) const; - float _4C; + float widthLimit; float charSpace; - float somethingRelatedToLineHeight; - u32 _58; + float lineSpace; + u32 tabWidth; u32 drawFlag; - void *tagProcessorMaybe; + void *tagProcessor; }; } } @@ -2662,7 +2705,7 @@ namespace m2d { nw4r::lyt::Pane *getRootPane(); nw4r::lyt::Pane *findPaneByName(const char *name) const; nw4r::lyt::TextBox *findTextBoxByName(const char *name) const; - nw4r::lyt::Pane *findPictureByName(const char *name) const; // TODO: change to others + nw4r::lyt::Picture *findPictureByName(const char *name) const; nw4r::lyt::Pane *findWindowByName(const char *name) const; void animate(); @@ -2700,10 +2743,10 @@ namespace m2d { // does NSMBW even use consts? I have no idea. maybe not - void getPanes(const char **names, nw4r::lyt::Pane *output, int count) const; - void getWindows(const char **names, nw4r::lyt::Pane *output, int count) const; // TODO: change to others - void getPictures(const char **names, nw4r::lyt::Pane *output, int count) const; - void getTextBoxes(const char **names, nw4r::lyt::TextBox *output, int count) const; + void getPanes(const char **names, nw4r::lyt::Pane **output, int count) const; + void getWindows(const char **names, nw4r::lyt::Pane **output, int count) const; // TODO: change to others + void getPictures(const char **names, nw4r::lyt::Picture **output, int count) const; + void getTextBoxes(const char **names, nw4r::lyt::TextBox **output, int count) const; void setLangStrings(const char **names, const int *msgIDs, int category, int count); -- cgit v1.2.3