mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-09 20:10:37 -04:00
Merge branch '26-02-27-pjb-dev-2' of https://github.com/TakaRikka/dusk into 26-02-27-pjb-dev-2
This commit is contained in:
Vendored
+1
-1
Submodule extern/aurora updated: 08e965bbe8...e4afaeeeb7
@@ -19,14 +19,14 @@ class JUTPalette;
|
||||
struct ResTIMG {
|
||||
/* 0x00 */ u8 format;
|
||||
/* 0x01 */ u8 alphaEnabled;
|
||||
/* 0x02 */ u16 width;
|
||||
/* 0x04 */ u16 height;
|
||||
/* 0x02 */ BE(u16) width;
|
||||
/* 0x04 */ BE(u16) height;
|
||||
/* 0x06 */ u8 wrapS;
|
||||
/* 0x07 */ u8 wrapT;
|
||||
/* 0x08 */ u8 indexTexture;
|
||||
/* 0x09 */ u8 colorFormat;
|
||||
/* 0x0A */ u16 numColors;
|
||||
/* 0x0C */ u32 paletteOffset;
|
||||
/* 0x0A */ BE(u16) numColors;
|
||||
/* 0x0C */ BE(u32) paletteOffset;
|
||||
/* 0x10 */ u8 mipmapEnabled;
|
||||
/* 0x11 */ u8 doEdgeLOD;
|
||||
/* 0x12 */ u8 biasClamp;
|
||||
@@ -37,8 +37,8 @@ struct ResTIMG {
|
||||
/* 0x17 */ s8 maxLOD;
|
||||
/* 0x18 */ u8 mipmapCount;
|
||||
/* 0x19 */ u8 unknown;
|
||||
/* 0x1A */ s16 LODBias;
|
||||
/* 0x1C */ u32 imageOffset;
|
||||
/* 0x1A */ BE(s16) LODBias;
|
||||
/* 0x1C */ BE(u32) imageOffset;
|
||||
}; // Size: 0x20
|
||||
|
||||
/**
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
const ResTIMG* getTexInfo() const { return mTexInfo; }
|
||||
s32 getFormat() const { return mTexInfo->format; }
|
||||
s32 getTransparency() const { return mTexInfo->alphaEnabled; }
|
||||
s32 getWidth() const { return RES_U16(mTexInfo->width); }
|
||||
s32 getHeight() const { return RES_U16(mTexInfo->height); }
|
||||
s32 getWidth() const { return mTexInfo->width; }
|
||||
s32 getHeight() const { return mTexInfo->height; }
|
||||
void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }
|
||||
bool getCaptureFlag() const { return mFlags & 1; }
|
||||
bool getEmbPaletteDelFlag() const { return mFlags & 2; }
|
||||
|
||||
@@ -17,7 +17,7 @@ JUTTexture::~JUTTexture() {
|
||||
void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
if (param_0 && param_1 < 0x10) {
|
||||
mTexInfo = param_0;
|
||||
u32 imgOffset = RES_U32(mTexInfo->imageOffset);
|
||||
u32 imgOffset = mTexInfo->imageOffset;
|
||||
mTexData = (void*)((intptr_t)mTexInfo + imgOffset);
|
||||
|
||||
if (mTexInfo->imageOffset == 0) {
|
||||
@@ -32,9 +32,9 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
mMagFilter = mTexInfo->magFilter;
|
||||
mMinLOD = (s8)mTexInfo->minLOD;
|
||||
mMaxLOD = (s8)mTexInfo->maxLOD;
|
||||
mLODBias = RES_S16(mTexInfo->LODBias);
|
||||
mLODBias = mTexInfo->LODBias;
|
||||
|
||||
u16 numColors = RES_U16(mTexInfo->numColors);
|
||||
u16 numColors = mTexInfo->numColors;
|
||||
|
||||
if (numColors == 0) {
|
||||
initTexObj();
|
||||
@@ -46,7 +46,7 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
tlut = (GXTlut)param_1;
|
||||
}
|
||||
|
||||
u32 palOffset = RES_U32(mTexInfo->paletteOffset);
|
||||
u32 palOffset = mTexInfo->paletteOffset;
|
||||
|
||||
if (mEmbPalette == NULL || !getEmbPaletteDelFlag()) {
|
||||
mEmbPalette = new JUTPalette(tlut, (GXTlutFmt)mTexInfo->colorFormat,
|
||||
@@ -142,13 +142,13 @@ void JUTTexture::init() {
|
||||
void JUTTexture::initTexObj() {
|
||||
GXBool mipmapEnabled = mTexInfo->mipmapEnabled != 0 ? GX_TRUE : GX_FALSE;
|
||||
u8* image = ((u8*)mTexInfo);
|
||||
u32 imgOffset = RES_U32(mTexInfo->imageOffset);
|
||||
u32 imgOffset = mTexInfo->imageOffset;
|
||||
image += (imgOffset ? imgOffset : 0x20);
|
||||
GXInitTexObj(&mTexObj, image, RES_U16(mTexInfo->width), RES_U16(mTexInfo->height),
|
||||
GXInitTexObj(&mTexObj, image, mTexInfo->width, mTexInfo->height,
|
||||
(GXTexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS, (GXTexWrapMode)mWrapT,
|
||||
mipmapEnabled);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter, mMinLOD / 8.0f,
|
||||
mMaxLOD / 8.0f, RES_S16(mLODBias) / 100.0f, mTexInfo->biasClamp,
|
||||
mMaxLOD / 8.0f, mLODBias / 100.0f, mTexInfo->biasClamp,
|
||||
mTexInfo->doEdgeLOD, (GXAnisotropy)mTexInfo->maxAnisotropy);
|
||||
}
|
||||
|
||||
@@ -156,16 +156,16 @@ void JUTTexture::initTexObj(GXTlut param_0) {
|
||||
GXBool mipmapEnabled = mTexInfo->mipmapEnabled != 0 ? GX_TRUE : GX_FALSE;
|
||||
mTlutName = param_0;
|
||||
u8* image = ((u8*)mTexInfo);
|
||||
u32 imgOffset = RES_U32(mTexInfo->imageOffset); // Swap!
|
||||
u32 imgOffset = mTexInfo->imageOffset;
|
||||
printf("[DIAG] initTexObj: Offset=%u, W=%u, H=%u, Ptr=%p\n", imgOffset, mTexInfo->width,
|
||||
mTexInfo->height,
|
||||
mTexInfo);
|
||||
image += (imgOffset ? imgOffset : 0x20);
|
||||
GXInitTexObjCI(&mTexObj, image, RES_U16(mTexInfo->width), RES_U16(mTexInfo->height),
|
||||
GXInitTexObjCI(&mTexObj, image, mTexInfo->width, mTexInfo->height,
|
||||
(GXCITexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS,
|
||||
(GXTexWrapMode)mWrapT, mipmapEnabled, param_0);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter, mMinLOD / 8.0f,
|
||||
mMaxLOD / 8.0f, RES_S16(mLODBias) / 100.0f, mTexInfo->biasClamp,
|
||||
mMaxLOD / 8.0f, mLODBias / 100.0f, mTexInfo->biasClamp,
|
||||
mTexInfo->doEdgeLOD, (GXAnisotropy)mTexInfo->maxAnisotropy);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ static int daVrbox_Draw(vrbox_class* i_this) {
|
||||
soraModel_p->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
dKy_GxFog_set();
|
||||
|
||||
#if !TARGET_PC
|
||||
// This code is broken but happens to not do anything on the real game.
|
||||
|
||||
// these casts look like fake matches, but this ptr is used as both J3DModel and J3DModelData?
|
||||
for (int i = ((J3DModelData*)soraModel_p)->getMaterialNum() - 1; i >= 0; i--) {
|
||||
J3DMaterial* material_p = ((J3DModelData*)soraModel_p)->getMaterialNodePointer(i);
|
||||
@@ -54,6 +57,7 @@ static int daVrbox_Draw(vrbox_class* i_this) {
|
||||
|
||||
fogInfo_p->mType = 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
dComIfGd_setListSky();
|
||||
mDoExt_modelUpdateDL(soraModel_p);
|
||||
|
||||
@@ -51,6 +51,9 @@ static int daVrbox2_Draw(vrbox2_class* i_this) {
|
||||
filelist_p = NULL;
|
||||
dKy_GxFog_set();
|
||||
|
||||
#if !TARGET_PC
|
||||
// Code is broken but does nothing on real hardware.
|
||||
|
||||
// these casts look like fake matches, but this ptr is used as both J3DModel and J3DModelData?
|
||||
sp38 = (J3DModelData*)kumo_model_p;
|
||||
sp34 = (J3DModelData*)sun_model_p;
|
||||
@@ -87,6 +90,7 @@ static int daVrbox2_Draw(vrbox2_class* i_this) {
|
||||
|
||||
fogInfo_p->mType = 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((g_env_light.vrbox_kasumi_outer_col.r + g_env_light.vrbox_kasumi_outer_col.g +
|
||||
g_env_light.vrbox_kasumi_outer_col.b + g_env_light.vrbox_sky_col.r + g_env_light.vrbox_sky_col.g +
|
||||
|
||||
@@ -246,12 +246,12 @@ static ResTIMG* createTimg(u16 width, u16 height, u32 format) {
|
||||
cLib_memSet(timg, 0, bufferSize);
|
||||
timg->format = format;
|
||||
timg->alphaEnabled = false;
|
||||
timg->width = RES_U16(width);
|
||||
timg->height = RES_U16(height);
|
||||
timg->width = width;
|
||||
timg->height = height;
|
||||
timg->minFilter = GX_LINEAR;
|
||||
timg->magFilter = GX_LINEAR;
|
||||
timg->mipmapCount = 1;
|
||||
timg->imageOffset = RES_U32(0x20);
|
||||
timg->imageOffset = 0x20;
|
||||
return timg;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user