diff options
| author | elijah-thomas774 <elijahthomas774@gmail.com> | 2025-03-22 13:50:29 -0400 |
|---|---|---|
| committer | elijah-thomas774 <elijahthomas774@gmail.com> | 2025-03-22 13:50:29 -0400 |
| commit | b16089a834bbdb3a68e64d1b54824d7768be63d5 (patch) | |
| tree | 2d59112fd23e08a974515c3b4eec9ab0b0c55292 /include/egg | |
| parent | 510df58ea4d587d3aeff295b4d05708fffd52d00 (diff) | |
convert CpuTexture to use ResTIMG header
Diffstat (limited to 'include/egg')
| -rw-r--r-- | include/egg/gfx/eggCpuTexture.h | 34 | ||||
| -rw-r--r-- | include/egg/gfx/eggTexture.h | 1 |
2 files changed, 5 insertions, 30 deletions
diff --git a/include/egg/gfx/eggCpuTexture.h b/include/egg/gfx/eggCpuTexture.h index 5c2e55cb..11096550 100644 --- a/include/egg/gfx/eggCpuTexture.h +++ b/include/egg/gfx/eggCpuTexture.h @@ -3,38 +3,14 @@ #include "common.h" #include "egg/core/eggHeap.h" +#include "egg/gfx/eggTexture.h" #include "rvl/GX/GXTexture.h" #include "rvl/GX/GXTypes.h" namespace EGG { class CpuTexture { - public: - struct Header { - u8 mTexFormat; - u8 BYTE_0x1; - u16 mWidth; - u16 mHeight; - u8 mWrapS; - u8 mWrapT; - u8 BYTE_0x8; - u8 BYTE_0x9; - u16 SHORT_0xA; - u32 WORD_0xC; - u8 BYTE_0xD; - u8 BYTE_0xE; - u8 BYTE_0xF; - u8 BYTE_0x10; - u8 mMinFilt; - u8 mMagFilt; - u8 BYTE_0x13; - u8 BYTE_0x14; - u8 BYTE_0x15; - u16 SHORT_0x16; - u32 WORD_0x18; - }; - enum TexFlag { CONFIGURED = 0x1, HAS_HEADER = 0x2, @@ -60,10 +36,10 @@ public: u32 getTexBufferSize() const; void buildHeader() const; - Header *initHeader(); + ResTIMG *initHeader(); void fillNormalMapSphere(f32, f32); - void fillGradient(int op, int, u16, u16, const GXColor&, const GXColor&, bool, bool); + void fillGradient(int op, int, u16, u16, const GXColor &, const GXColor &, bool, bool); void setColor(u16 x, u16 y, GXColor color); GXColor getColor(u16 x, u16 y) const; @@ -127,8 +103,8 @@ public: mMagFilt = filt; } - Header *getHeader() const { - return (Header *)((u8 *)dataPtr - sizeof(Header)); + ResTIMG *getHeader() const { + return (ResTIMG *)((u8 *)dataPtr - sizeof(ResTIMG)); } void *getBuffer() const { diff --git a/include/egg/gfx/eggTexture.h b/include/egg/gfx/eggTexture.h index e166b882..10420822 100644 --- a/include/egg/gfx/eggTexture.h +++ b/include/egg/gfx/eggTexture.h @@ -29,7 +29,6 @@ struct ResTIMG { /* 0x16 */ s8 minLOD; /* 0x17 */ s8 maxLOD; /* 0x18 */ u8 mipmapCount; - /* 0x19 */ u8 unknown; /* 0x1A */ s16 LODBias; /* 0x1C */ u32 imageOffset; }; |
