move J2D / JUTResFont (#144)

* move some JSystem and meter2_info stuff

* more J2D / JUTTexture / JUTPalette

* setup dScnKy_env_light_c
This commit is contained in:
TakaRikka
2021-08-28 07:25:03 -07:00
committed by GitHub
parent e14b04c54a
commit daf45f768d
167 changed files with 3800 additions and 5691 deletions
+64 -29
View File
@@ -1,46 +1,82 @@
#ifndef JUTFONT_H
#define JUTFONT_H
#include "JSystem/JUtility.h"
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
namespace JUtility {
struct ResFONT {
struct INF1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 fontType;
/* 0x0A */ u16 ascent;
/* 0x0C */ u16 descent;
/* 0x0E */ u16 width;
/* 0x10 */ u16 leading;
/* 0x12 */ u16 defaultCode;
};
struct TColor : _GXColor {
TColor() { set(-1); }
struct WID1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 startCode;
/* 0x0A */ u16 endCode;
};
TColor(u32 raw) { *(u32*)&r = raw; }
struct MAP1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 mappingMethod;
/* 0x0A */ u16 startCode;
/* 0x0C */ u16 endCode;
/* 0x0E */ u16 numEntries;
};
void set(u32 col) { *(u32*)&r = col; }
struct GLY1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 startCode;
/* 0x0A */ u16 endCode;
/* 0x0C */ u16 cellWidth;
/* 0x0E */ u16 cellHeight;
/* 0x10 */ u32 textureSize;
/* 0x14 */ u16 textureFormat;
/* 0x16 */ u16 numRows;
/* 0x18 */ u16 numColumns;
/* 0x1A */ u16 textureWidth;
/* 0x1C */ u16 textureHeight;
};
u32 toUInt32() const { return *(u32*)&r; }
operator u32() const { return toUInt32(); }
void operator=(const TColor& rhs) { ((_GXColor*)this)->operator=(rhs); }
/* 0x00 */ u64 magic;
/* 0x08 */ u32 filesize;
/* 0x0C */ u32 numBlocks;
/* 0x10 */ u8 padding[0x10];
};
} // namespace JUtility
class JUTFont {
public:
JUTFont();
virtual ~JUTFont() {}
struct TWidth {};
struct TWidth {
u8 field_0x0;
u8 field_0x1;
};
/* 0x0c */ virtual void setGX() = 0;
/* 0x0C */ virtual void setGX() = 0;
/* 0x10 */ virtual void setGX(JUtility::TColor col1, JUtility::TColor col2);
/* 0x14 */ virtual f32 drawChar_scale(f32 a1, f32 a2, f32 a3, f32 a4, int a5, bool a6) = 0;
/* 0x18 */ virtual u16 getLeading() const = 0;
/* 0x1c */ virtual u16 getAscent() const = 0;
/* 0x1C */ virtual u16 getAscent() const = 0;
/* 0x20 */ virtual u16 getDescent() const = 0;
/* 0x24 */ virtual u32 getHeight() const = 0;
/* 0x28 */ virtual u32 getWidth() const = 0;
/* 0x2c */ virtual void getWidthEntry(int i_no, TWidth* width) const;
/* 0x30 */ virtual u32 getCellWidth() const;
/* 0x34 */ virtual u32 getCellHeight() const;
/* 0x38 */ virtual u32 getFontType() const = 0;
/* 0x3c */ virtual void getResFont() const = 0;
/* 0x24 */ virtual u16 getHeight() const = 0;
/* 0x28 */ virtual u16 getWidth() const = 0;
/* 0x2C */ virtual void getWidthEntry(int i_no, TWidth* width) const;
/* 0x30 */ virtual u16 getCellWidth() const;
/* 0x34 */ virtual u16 getCellHeight() const;
/* 0x38 */ virtual u16 getFontType() const = 0;
/* 0x3C */ virtual ResFONT* getResFont() const = 0;
/* 0x40 */ virtual bool isLeadByte(int a1) const = 0;
static bool isLeadByte_1Byte(int b);
@@ -52,14 +88,13 @@ public:
void setGradColor(JUtility::TColor col1, JUtility::TColor col2);
f32 drawString_size_scale(f32 a1, f32 a2, f32 a3, f32 a4, const char* a5, u32 usz, bool a7);
u8 unk4;
bool unk5;
int unk8;
JUtility::TColor mColor1;
JUtility::TColor mColor2;
JUtility::TColor mColor3;
JUtility::TColor mColor4;
int unk1C;
/* 0x04 */ bool mValid;
/* 0x05 */ bool mFixed;
/* 0x08 */ int mFixedWidth;
/* 0x0C */ JUtility::TColor mColor1;
/* 0x10 */ JUtility::TColor mColor2;
/* 0x14 */ JUtility::TColor mColor3;
/* 0x18 */ JUtility::TColor mColor4;
};
#endif /* JUTFONT_H */