mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-07 20:11:46 -04:00
Merge remote-tracking branch 'origin/main' into android-building
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
|
||||
libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
|
||||
libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
|
||||
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev
|
||||
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \
|
||||
libxss-dev libxtst-dev
|
||||
```
|
||||
* Arch Linux packages
|
||||
```
|
||||
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
/* 0x790 */ s16 mRotSpeed;
|
||||
|
||||
public:
|
||||
static u32 const M_attr;
|
||||
static s16 const M_attr[2];
|
||||
};
|
||||
|
||||
#endif /* D_A_OBJ_CATDOOR_H */
|
||||
|
||||
@@ -64,7 +64,8 @@ struct UserSettings {
|
||||
|
||||
// Input
|
||||
ConfigVar<bool> enableGyroAim;
|
||||
ConfigVar<float> gyroAimSensitivity;
|
||||
ConfigVar<float> gyroAimSensitivityX;
|
||||
ConfigVar<float> gyroAimSensitivityY;
|
||||
ConfigVar<bool> gyroAimInvertPitch;
|
||||
ConfigVar<bool> gyroAimInvertYaw;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
/* 0x06 */ u16 mUniqueMatNum;
|
||||
/* 0x08 */ J3DMaterial** mMaterialNodePointer;
|
||||
/* 0x0C */ JUTNameTab* mMaterialName;
|
||||
/* 0x10 */ J3DMaterial* field_0x10;
|
||||
/* 0x10 */ J3DMaterial* mMaterial;
|
||||
/* 0x14 */ J3DTexture* mTexture;
|
||||
/* 0x18 */ JUTNameTab* mTextureName;
|
||||
/* 0x1C */ u16 field_0x1c;
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
/* 0x14 */ u16 mIndex;
|
||||
/* 0x18 */ u32 mInvalid;
|
||||
/* 0x1C */ u32 field_0x1c;
|
||||
/* 0x20 */ u32 mDiffFlag;
|
||||
/* 0x20 */ u32 mMaterialID;
|
||||
/* 0x24 */ J3DColorBlock* mColorBlock;
|
||||
/* 0x28 */ J3DTexGenBlock* mTexGenBlock;
|
||||
/* 0x2C */ J3DTevBlock* mTevBlock;
|
||||
|
||||
@@ -31,8 +31,6 @@ enum J3DDiffFlag {
|
||||
J3DDiffFlag_TevStageIndirect = 0x8000000,
|
||||
J3DDiffFlag_Fog = 0x10000000,
|
||||
J3DDiffFlag_Blend = 0x20000000,
|
||||
J3DDiffFlag_Unk40000000 = 0x40000000,
|
||||
J3DDiffFlag_Changed = 0x80000000,
|
||||
};
|
||||
|
||||
#define J3D_DIFF_LIGHTOBJNUM(n) ((n & 0xF) << 4)
|
||||
@@ -309,9 +307,9 @@ public:
|
||||
}
|
||||
|
||||
void setInitShapePacket(J3DShapePacket* packet) { mpInitShapePacket = packet; }
|
||||
void setMaterialID(u32 id) { mDiffFlag = id; }
|
||||
void setMaterialID(u32 id) { mMaterialID = id; }
|
||||
void setMaterialAnmID(J3DMaterialAnm* materialAnm) { mpMaterialAnm = materialAnm; }
|
||||
BOOL isChanged() { return mDiffFlag & J3DDiffFlag_Changed; }
|
||||
BOOL isChanged() { return mMaterialID & 0x80000000; }
|
||||
bool isEnabled_Diff() { return mpInitShapePacket->getDisplayListObj() != NULL; }
|
||||
|
||||
virtual ~J3DMatPacket();
|
||||
@@ -322,7 +320,7 @@ public:
|
||||
/* 0x28 */ J3DShapePacket* mpInitShapePacket;
|
||||
/* 0x2C */ J3DShapePacket* mpShapePacket;
|
||||
/* 0x30 */ J3DMaterial* mpMaterial;
|
||||
/* 0x34 */ u32 mDiffFlag;
|
||||
/* 0x34 */ u32 mMaterialID;
|
||||
/* 0x38 */ J3DTexture* mpTexture;
|
||||
/* 0x3C */ J3DMaterialAnm* mpMaterialAnm;
|
||||
}; // Size: 0x40
|
||||
|
||||
@@ -11,7 +11,7 @@ void J3DMaterialTable::clear() {
|
||||
mUniqueMatNum = 0;
|
||||
mMaterialNodePointer = NULL;
|
||||
mMaterialName = NULL;
|
||||
field_0x10 = 0;
|
||||
mMaterial = NULL;
|
||||
mTexture = NULL;
|
||||
mTextureName = NULL;
|
||||
field_0x1c = 0;
|
||||
@@ -22,7 +22,7 @@ J3DMaterialTable::J3DMaterialTable() {
|
||||
mUniqueMatNum = 0;
|
||||
mMaterialNodePointer = NULL;
|
||||
mMaterialName = NULL;
|
||||
field_0x10 = 0;
|
||||
mMaterial = NULL;
|
||||
mTexture = NULL;
|
||||
mTextureName = NULL;
|
||||
field_0x1c = 0;
|
||||
|
||||
@@ -138,7 +138,7 @@ s32 J3DModel::createMatPacket(J3DModelData* pModelData, u32 mdlFlags) {
|
||||
matPacket->setInitShapePacket(shapePacket);
|
||||
matPacket->addShapePacket(shapePacket);
|
||||
matPacket->setTexture(pModelData->getTexture());
|
||||
matPacket->setMaterialID(materialNode->mDiffFlag);
|
||||
matPacket->setMaterialID(materialNode->mMaterialID);
|
||||
|
||||
if (pModelData->getModelDataType() == 1) {
|
||||
matPacket->lock();
|
||||
|
||||
@@ -176,7 +176,7 @@ void J3DMaterial::initialize() {
|
||||
mMaterialMode = 1;
|
||||
mIndex = -1;
|
||||
mInvalid = 0;
|
||||
mDiffFlag = 0;
|
||||
mMaterialID = 0;
|
||||
mColorBlock = NULL;
|
||||
mTexGenBlock = NULL;
|
||||
mTevBlock = NULL;
|
||||
@@ -207,7 +207,7 @@ void J3DMaterial::makeDisplayList_private(J3DDisplayListObj* pDLObj) {
|
||||
|
||||
void J3DMaterial::makeDisplayList() {
|
||||
if (!j3dSys.getMatPacket()->isLocked()) {
|
||||
j3dSys.getMatPacket()->mDiffFlag = mDiffFlag;
|
||||
j3dSys.getMatPacket()->setMaterialID(mMaterialID);
|
||||
makeDisplayList_private(j3dSys.getMatPacket()->getDisplayListObj());
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ void J3DMaterial::loadSharedDL() {
|
||||
}
|
||||
|
||||
void J3DMaterial::patch() {
|
||||
j3dSys.getMatPacket()->mDiffFlag = mDiffFlag;
|
||||
j3dSys.getMatPacket()->setMaterialID(mMaterialID);
|
||||
j3dSys.getMatPacket()->beginPatch();
|
||||
mTevBlock->patch();
|
||||
mColorBlock->patch();
|
||||
@@ -323,8 +323,8 @@ void J3DMaterial::copy(J3DMaterial* pOther) {
|
||||
}
|
||||
|
||||
void J3DMaterial::reset() {
|
||||
if ((~mDiffFlag & J3DDiffFlag_Changed) == 0) {
|
||||
mDiffFlag &= ~J3DDiffFlag_Changed;
|
||||
if ((~mMaterialID & 0x80000000) == 0) {
|
||||
mMaterialID &= ~0x80000000;
|
||||
mMaterialMode = mpOrigMaterial->mMaterialMode;
|
||||
mInvalid = mpOrigMaterial->mInvalid;
|
||||
mMaterialAnm = NULL;
|
||||
@@ -333,8 +333,8 @@ void J3DMaterial::reset() {
|
||||
}
|
||||
|
||||
void J3DMaterial::change() {
|
||||
if ((mDiffFlag & (J3DDiffFlag_Changed | J3DDiffFlag_Unk40000000)) == 0) {
|
||||
mDiffFlag |= J3DDiffFlag_Changed;
|
||||
if ((mMaterialID & 0xC0000000) == 0) {
|
||||
mMaterialID |= 0x80000000;
|
||||
mMaterialAnm = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ J3DMatPacket::J3DMatPacket() {
|
||||
mpInitShapePacket = NULL;
|
||||
mpShapePacket = NULL;
|
||||
mpMaterial = NULL;
|
||||
mDiffFlag = 0xFFFFFFFF;
|
||||
mMaterialID = 0xFFFFFFFF;
|
||||
mpTexture = NULL;
|
||||
mpMaterialAnm = NULL;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ void J3DMatPacket::endDiff() {
|
||||
|
||||
bool J3DMatPacket::isSame(J3DMatPacket* pOther) const {
|
||||
J3D_ASSERT_NULLPTR(521, pOther != NULL);
|
||||
return mDiffFlag == pOther->mDiffFlag && (mDiffFlag >> 31) == 0;
|
||||
return mMaterialID == pOther->mMaterialID && (mMaterialID & 0x80000000) == 0;
|
||||
}
|
||||
|
||||
void J3DMatPacket::draw() {
|
||||
|
||||
@@ -618,6 +618,12 @@ void J3DModelLoader::readJoint(J3DJointBlock const* i_block) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
#define MATERIAL_ID(ptr, offset) (((uintptr_t((ptr)) >> 4) & 0x3FFFFFFF) + (offset))
|
||||
#else
|
||||
#define MATERIAL_ID(ptr, offset) (((uintptr_t((ptr)) >> 4) + (offset)))
|
||||
#endif
|
||||
|
||||
void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* i_block, u32 i_flags) {
|
||||
J3D_ASSERT_NULLPTR(817, i_block);
|
||||
J3DMaterialFactory factory(*i_block);
|
||||
@@ -633,16 +639,16 @@ void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* i_block, u32 i_fla
|
||||
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
|
||||
J3D_ASSERT_ALLOCMEM(841, mpMaterialTable->mMaterialNodePointer);
|
||||
if (i_flags & 0x200000) {
|
||||
mpMaterialTable->field_0x10 = JKR_NEW_ARRAY_ARGS(J3DMaterial, mpMaterialTable->mUniqueMatNum, 0x20);
|
||||
J3D_ASSERT_ALLOCMEM(846, mpMaterialTable->field_0x10);
|
||||
mpMaterialTable->mMaterial = JKR_NEW_ARRAY_ARGS(J3DMaterial, mpMaterialTable->mUniqueMatNum, 0x20);
|
||||
J3D_ASSERT_ALLOCMEM(846, mpMaterialTable->mMaterial);
|
||||
} else {
|
||||
mpMaterialTable->field_0x10 = NULL;
|
||||
mpMaterialTable->mMaterial = NULL;
|
||||
}
|
||||
if (i_flags & 0x200000) {
|
||||
for (u16 i = 0; i < mpMaterialTable->mUniqueMatNum; i++) {
|
||||
factory.create(&mpMaterialTable->field_0x10[i],
|
||||
factory.create(&mpMaterialTable->mMaterial[i],
|
||||
J3DMaterialFactory::MATERIAL_TYPE_NORMAL, i, i_flags);
|
||||
mpMaterialTable->field_0x10[i].mDiffFlag = (uintptr_t)&mpMaterialTable->field_0x10[i] >> 4;
|
||||
mpMaterialTable->mMaterial[i].mMaterialID = MATERIAL_ID(&mpMaterialTable->mMaterial[i], 0);
|
||||
}
|
||||
}
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
@@ -651,15 +657,15 @@ void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* i_block, u32 i_fla
|
||||
}
|
||||
if (i_flags & 0x200000) {
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag =
|
||||
(uintptr_t)&mpMaterialTable->field_0x10[factory.getMaterialID(i)] >> 4;
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID =
|
||||
MATERIAL_ID(&mpMaterialTable->mMaterial[factory.getMaterialID(i)], 0);
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mpOrigMaterial =
|
||||
&mpMaterialTable->field_0x10[factory.getMaterialID(i)];
|
||||
&mpMaterialTable->mMaterial[factory.getMaterialID(i)];
|
||||
}
|
||||
} else {
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag =
|
||||
((uintptr_t)mpMaterialTable->mMaterialNodePointer >> 4) + factory.getMaterialID(i);
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID =
|
||||
MATERIAL_ID(mpMaterialTable->mMaterialNodePointer, factory.getMaterialID(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -679,15 +685,15 @@ void J3DModelLoader_v21::readMaterial_v21(J3DMaterialBlock_v21 const* i_block, u
|
||||
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
|
||||
J3D_ASSERT_ALLOCMEM(940, mpMaterialTable->mMaterialNodePointer);
|
||||
if (i_flags & 0x200000) {
|
||||
mpMaterialTable->field_0x10 = JKR_NEW_ARRAY_ARGS(J3DMaterial, mpMaterialTable->mUniqueMatNum, 0x20);
|
||||
J3D_ASSERT_ALLOCMEM(945, mpMaterialTable->field_0x10);
|
||||
mpMaterialTable->mMaterial = JKR_NEW_ARRAY_ARGS(J3DMaterial, mpMaterialTable->mUniqueMatNum, 0x20);
|
||||
J3D_ASSERT_ALLOCMEM(945, mpMaterialTable->mMaterial);
|
||||
} else {
|
||||
mpMaterialTable->field_0x10 = NULL;
|
||||
mpMaterialTable->mMaterial = NULL;
|
||||
}
|
||||
if (i_flags & 0x200000) {
|
||||
for (u16 i = 0; i < mpMaterialTable->mUniqueMatNum; i++) {
|
||||
factory.create(&mpMaterialTable->field_0x10[i], i, i_flags);
|
||||
mpMaterialTable->field_0x10[i].mDiffFlag = (uintptr_t)&mpMaterialTable->field_0x10[i] >> 4;
|
||||
factory.create(&mpMaterialTable->mMaterial[i], i, i_flags);
|
||||
mpMaterialTable->mMaterial[i].mMaterialID = MATERIAL_ID(&mpMaterialTable->mMaterial[i], 0);
|
||||
}
|
||||
}
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
@@ -695,14 +701,14 @@ void J3DModelLoader_v21::readMaterial_v21(J3DMaterialBlock_v21 const* i_block, u
|
||||
}
|
||||
if (i_flags & 0x200000) {
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag =
|
||||
(uintptr_t)&mpMaterialTable->field_0x10[factory.getMaterialID(i)] >> 4;
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID =
|
||||
MATERIAL_ID(&mpMaterialTable->mMaterial[factory.getMaterialID(i)], 0);
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mpOrigMaterial =
|
||||
&mpMaterialTable->field_0x10[factory.getMaterialID(i)];
|
||||
&mpMaterialTable->mMaterial[factory.getMaterialID(i)];
|
||||
}
|
||||
} else {
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = 0xc0000000;
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID = 0xC0000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -767,8 +773,8 @@ void J3DModelLoader_v26::readMaterialTable(J3DMaterialBlock const* i_block, u32
|
||||
factory.create(NULL, J3DMaterialFactory::MATERIAL_TYPE_NORMAL, i, i_flags);
|
||||
}
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag =
|
||||
(uintptr_t)mpMaterialTable->mMaterialNodePointer + factory.getMaterialID(i);
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID =
|
||||
MATERIAL_ID(mpMaterialTable->mMaterialNodePointer, factory.getMaterialID(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,8 +796,8 @@ void J3DModelLoader_v21::readMaterialTable_v21(J3DMaterialBlock_v21 const* i_blo
|
||||
factory.create(NULL, i, i_flags);
|
||||
}
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag =
|
||||
((uintptr_t)mpMaterialTable->mMaterialNodePointer >> 4) + factory.getMaterialID(i);
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID =
|
||||
MATERIAL_ID(mpMaterialTable->mMaterialNodePointer, factory.getMaterialID(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,12 +830,12 @@ void J3DModelLoader::readPatchedMaterial(J3DMaterialBlock const* i_block, u32 i_
|
||||
}
|
||||
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
|
||||
J3D_ASSERT_ALLOCMEM(1260, mpMaterialTable->mMaterialNodePointer);
|
||||
mpMaterialTable->field_0x10 = NULL;
|
||||
mpMaterialTable->mMaterial = NULL;
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i] =
|
||||
factory.create(NULL, J3DMaterialFactory::MATERIAL_TYPE_PATCHED, i, i_flags);
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag =
|
||||
((uintptr_t)mpMaterialTable->mMaterialNodePointer >> 4) + factory.getMaterialID(i);
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID =
|
||||
MATERIAL_ID(mpMaterialTable->mMaterialNodePointer, factory.getMaterialID(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,14 +856,14 @@ void J3DModelLoader::readMaterialDL(J3DMaterialDLBlock const* i_block, u32 i_fla
|
||||
}
|
||||
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
|
||||
J3D_ASSERT_ALLOCMEM(1320, mpMaterialTable->mMaterialNodePointer);
|
||||
mpMaterialTable->field_0x10 = NULL;
|
||||
mpMaterialTable->mMaterial = NULL;
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
flags = i_flags;
|
||||
mpMaterialTable->mMaterialNodePointer[i] =
|
||||
factory.create(NULL, J3DMaterialFactory::MATERIAL_TYPE_LOCKED, i, flags);
|
||||
}
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = 0xc0000000;
|
||||
mpMaterialTable->mMaterialNodePointer[i]->mMaterialID = 0xC0000000;
|
||||
}
|
||||
} else {
|
||||
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
static const char* l_arcName = "CatDoor";
|
||||
|
||||
u32 const daObjCatDoor_c::M_attr = 0x001E0578;
|
||||
s16 const daObjCatDoor_c::M_attr[2] = {0x001E, 0x0578};
|
||||
|
||||
daObjCatDoor_c::~daObjCatDoor_c() {
|
||||
if (mDoor1.bgw.ChkUsed()) {
|
||||
@@ -71,7 +71,7 @@ int daObjCatDoor_c::execute() {
|
||||
}
|
||||
|
||||
const s16* daObjCatDoor_c::attr() const {
|
||||
return (const s16*)&daObjCatDoor_c::M_attr;
|
||||
return daObjCatDoor_c::M_attr;
|
||||
}
|
||||
|
||||
static int createSolidHeap(fopAc_ac_c* i_this) {
|
||||
|
||||
+15
-2
@@ -1824,11 +1824,24 @@ static u16 const l_drawlistSize[21] = {
|
||||
};
|
||||
|
||||
static u8 const l_nonSortId[9] = {
|
||||
0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x09, 0x12, 0x0D,
|
||||
dDlst_list_c::DB_OPA_LIST_SKY,
|
||||
dDlst_list_c::DB_XLU_LIST_SKY,
|
||||
dDlst_list_c::DB_LIST_P0,
|
||||
dDlst_list_c::DB_XLU_LIST_BG,
|
||||
dDlst_list_c::DB_OPA_LIST_DARK_BG,
|
||||
dDlst_list_c::DB_XLU_LIST_DARK_BG,
|
||||
dDlst_list_c::DB_OPA_LIST_DARK,
|
||||
dDlst_list_c::DB_LIST_2D_SCREEN,
|
||||
dDlst_list_c::DB_OPA_LIST_ITEM3D,
|
||||
};
|
||||
|
||||
static const u8 l_zSortId[6] = {
|
||||
0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x11,
|
||||
dDlst_list_c::DB_XLU_LIST,
|
||||
dDlst_list_c::DB_XLU_LIST_DARK,
|
||||
dDlst_list_c::DB_LIST_FILTER,
|
||||
dDlst_list_c::DB_XLU_LIST_ITEM3D,
|
||||
dDlst_list_c::DB_XLU_LIST_INVISIBLE,
|
||||
dDlst_list_c::DB_LIST_Z_XLU,
|
||||
};
|
||||
|
||||
void dDlst_list_c::init() {
|
||||
|
||||
@@ -61,9 +61,8 @@ void read(float dt, bool context_active) {
|
||||
float yaw_rate = apply_deadband(s_smooth_gy);
|
||||
float pitch_rate = apply_deadband(s_smooth_gx);
|
||||
|
||||
const float sens = dusk::getSettings().game.gyroAimSensitivity;
|
||||
s_pending_yaw_rad += yaw_rate * dt * sens;
|
||||
s_pending_pitch_rad += pitch_rate * dt * sens;
|
||||
s_pending_yaw_rad += yaw_rate * dt * dusk::getSettings().game.gyroAimSensitivityX;
|
||||
s_pending_pitch_rad += pitch_rate * dt * dusk::getSettings().game.gyroAimSensitivityY;
|
||||
}
|
||||
|
||||
void consumeAimDeltas(float& out_yaw_rad, float& out_pitch_rad) {
|
||||
|
||||
@@ -4,67 +4,47 @@
|
||||
#include "ImGuiConsole.hpp"
|
||||
|
||||
void DuskDebugPad() {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_K)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_A;
|
||||
auto& pad = mDoCPd_c::getCpadInfo(PAD_1);
|
||||
auto KeyFlag = [&](ImGuiKey key, u32 padFlag) {
|
||||
if (ImGui::IsKeyDown(key))
|
||||
pad.mButtonFlags |= padFlag;
|
||||
if (ImGui::IsKeyPressed(key))
|
||||
pad.mPressedButtonFlags |= padFlag;
|
||||
|
||||
};
|
||||
|
||||
KeyFlag(ImGuiKey_K, PAD_BUTTON_A);
|
||||
KeyFlag(ImGuiKey_J, PAD_BUTTON_B);
|
||||
KeyFlag(ImGuiKey_L, PAD_BUTTON_X);
|
||||
KeyFlag(ImGuiKey_I, PAD_BUTTON_Y);
|
||||
KeyFlag(ImGuiKey_H, PAD_BUTTON_START);
|
||||
KeyFlag(ImGuiKey_O, PAD_TRIGGER_Z);
|
||||
KeyFlag(ImGuiKey_Keypad8, PAD_BUTTON_UP);
|
||||
KeyFlag(ImGuiKey_Keypad2, PAD_BUTTON_DOWN);
|
||||
KeyFlag(ImGuiKey_Keypad6, PAD_BUTTON_RIGHT);
|
||||
KeyFlag(ImGuiKey_Keypad4, PAD_BUTTON_LEFT);
|
||||
|
||||
if (ImGui::IsKeyDown(ImGuiKey_W)) {
|
||||
pad.mMainStickPosY = 1.0f;
|
||||
pad.mMainStickValue = 1.0f;
|
||||
pad.mMainStickAngle = 0x8000;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_J)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_B;
|
||||
if (ImGui::IsKeyDown(ImGuiKey_S)) {
|
||||
pad.mMainStickPosY = -1.0f;
|
||||
pad.mMainStickValue = 1.0f;
|
||||
pad.mMainStickAngle = 0;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_L)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_X;
|
||||
if (ImGui::IsKeyDown(ImGuiKey_D)) {
|
||||
pad.mMainStickPosX = 1.0f;
|
||||
pad.mMainStickValue = 1.0f;
|
||||
pad.mMainStickAngle = 0x4000;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_I)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_Y;
|
||||
if (ImGui::IsKeyDown(ImGuiKey_A)) {
|
||||
pad.mMainStickPosX = -1.0f;
|
||||
pad.mMainStickValue = 1.0f;
|
||||
pad.mMainStickAngle = -0x4000;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_H)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_START;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_O)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_TRIGGER_Z;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Keypad8)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_UP;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Keypad2)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_DOWN;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Keypad6)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_RIGHT;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Keypad4)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags |= PAD_BUTTON_LEFT;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_W)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickPosY = 1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickValue = 1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickAngle = 0x8000;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_S)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickPosY = -1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickValue = 1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickAngle = 0;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_D)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickPosX = 1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickValue = 1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickAngle = 0x4000;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_A)) {
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickPosX = -1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickValue = 1.0f;
|
||||
mDoCPd_c::getCpadInfo(PAD_1).mMainStickAngle = -0x4000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,8 @@ namespace dusk {
|
||||
"Slingshot, Gale Boomerang, Hero's Bow, Clawshot(s), Ball and Chain, and Dominion Rod.");
|
||||
}
|
||||
|
||||
config::ImGuiSliderFloat("Gyro Sensitivity", getSettings().game.gyroAimSensitivity, 0.25f, 4.0f, "%.2f");
|
||||
config::ImGuiSliderFloat("Gyro Pitch Sensitivity", getSettings().game.gyroAimSensitivityY, 0.25f, 4.0f, "%.2f");
|
||||
config::ImGuiSliderFloat("Gyro Yaw Sensitivity", getSettings().game.gyroAimSensitivityX, 0.25f, 4.0f, "%.2f");
|
||||
config::ImGuiCheckbox("Invert Gyro Pitch", getSettings().game.gyroAimInvertPitch);
|
||||
config::ImGuiCheckbox("Invert Gyro Yaw", getSettings().game.gyroAimInvertYaw);
|
||||
|
||||
|
||||
@@ -52,7 +52,8 @@ UserSettings g_userSettings = {
|
||||
|
||||
// Input
|
||||
.enableGyroAim {"game.enableGyroAim", false},
|
||||
.gyroAimSensitivity {"game.gyroAimSensitivity", 1.0f},
|
||||
.gyroAimSensitivityX {"game.gyroAimSensitivityX", 1.0f},
|
||||
.gyroAimSensitivityY {"game.gyroAimSensitivityY", 1.0f},
|
||||
.gyroAimInvertPitch {"game.gyroAimInvertPitch", false},
|
||||
.gyroAimInvertYaw {"game.gyroAimInvertYaw", false},
|
||||
|
||||
@@ -126,7 +127,8 @@ void registerSettings() {
|
||||
Register(g_userSettings.game.fastSpinner);
|
||||
Register(g_userSettings.game.enableFrameInterpolation);
|
||||
Register(g_userSettings.game.enableGyroAim);
|
||||
Register(g_userSettings.game.gyroAimSensitivity);
|
||||
Register(g_userSettings.game.gyroAimSensitivityX);
|
||||
Register(g_userSettings.game.gyroAimSensitivityY);
|
||||
Register(g_userSettings.game.gyroAimInvertPitch);
|
||||
Register(g_userSettings.game.gyroAimInvertYaw);
|
||||
|
||||
|
||||
+197
-18
@@ -1232,12 +1232,12 @@ void mDoGph_drawFilterQuad(s8 param_0, s8 param_1) {
|
||||
void mDoGph_gInf_c::bloom_c::create() {
|
||||
if (m_buffer == NULL) {
|
||||
#ifdef TARGET_PC
|
||||
u32 size = 0x20; // No need to allocate memory for texture
|
||||
m_buffer = (void*)1;
|
||||
#else
|
||||
u32 size = GXGetTexBufferSize(FB_WIDTH / 2, FB_HEIGHT / 2, GX_TF_RGBA8, GX_FALSE, 0);
|
||||
#endif
|
||||
m_buffer = mDoExt_getArchiveHeap()->alloc(size, -32);
|
||||
JUT_ASSERT(1621, m_buffer != NULL);
|
||||
#endif
|
||||
|
||||
mEnable = false;
|
||||
mMode = 0;
|
||||
@@ -1249,20 +1249,202 @@ void mDoGph_gInf_c::bloom_c::create() {
|
||||
}
|
||||
|
||||
void mDoGph_gInf_c::bloom_c::remove() {
|
||||
#if !TARGET_PC
|
||||
if (m_buffer != NULL) {
|
||||
mDoExt_getArchiveHeap()->free(m_buffer);
|
||||
m_buffer = NULL;
|
||||
}
|
||||
#endif
|
||||
mMonoColor.a = 0;
|
||||
}
|
||||
|
||||
void mDoGph_gInf_c::bloom_c::draw() {
|
||||
|
||||
#if TARGET_PC
|
||||
static void CopyToTexObj(GXTexObj* pDst, uintptr_t texID, int dstWidth, int dstHeight, GXTexFmt dstFmt = GX_TF_RGBA8) {
|
||||
GXSetTexCopyDst(dstWidth, dstHeight, dstFmt, FALSE);
|
||||
GXCopyTex((void*)texID, false);
|
||||
GXInitTexObj(pDst, (void*)texID, dstWidth, dstHeight, dstFmt, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(pDst, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
}
|
||||
|
||||
void mDoGph_gInf_c::bloom_c::draw() {
|
||||
ZoneScoped;
|
||||
if (!dusk::getSettings().game.enableBloom) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool enabled = mEnable;
|
||||
if (mMonoColor.a == 0 && !enabled)
|
||||
return;
|
||||
|
||||
f32 width = mDoGph_gInf_c::getWidth();
|
||||
f32 height = mDoGph_gInf_c::getHeight();
|
||||
GXSetViewport(0.0f, 0.0f, width, height, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, width, height);
|
||||
|
||||
GXLoadTexObj(getFrameBufferTexObj(), GX_TEXMAP0);
|
||||
GXSetNumChans(0);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x3c);
|
||||
GXSetTevSwapModeTable(GX_TEV_SWAP1, GX_CH_RED, GX_CH_RED, GX_CH_RED, GX_CH_GREEN);
|
||||
GXSetTevSwapModeTable(GX_TEV_SWAP3, GX_CH_BLUE, GX_CH_BLUE, GX_CH_BLUE, GX_CH_ALPHA);
|
||||
GXSetZCompLoc(1);
|
||||
GXSetZMode(0, GX_ALWAYS, 0);
|
||||
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0);
|
||||
GXSetFog(GX_FOG_NONE, 0.0f, 0.0f, 0.0f, 0.0f, g_clearColor);
|
||||
GXSetFogRangeAdj(0, 0, 0);
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXSetDither(1);
|
||||
Mtx44 ortho;
|
||||
C_MTXOrtho(ortho, 0.0f, height, 0.0f, width, 0.0f, 10.0f);
|
||||
GXLoadPosMtxImm(cMtx_getIdentity(), 0);
|
||||
GXSetProjection(ortho, GX_ORTHOGRAPHIC);
|
||||
GXSetCurrentMtx(0);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_S8, 0);
|
||||
|
||||
auto filterQuad = [&](int div) {
|
||||
f32 x = width / div, y = height / div;
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32(0, 0, -5);
|
||||
GXTexCoord2s8(0, 0);
|
||||
GXPosition3f32(x, 0, -5);
|
||||
GXTexCoord2s8(1, 0);
|
||||
GXPosition3f32(x, y, -5);
|
||||
GXTexCoord2s8(1, 1);
|
||||
GXPosition3f32(0, y, -5);
|
||||
GXTexCoord2s8(0, 1);
|
||||
GXEnd();
|
||||
};
|
||||
|
||||
if (mMonoColor.a != 0) {
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_C2, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A2);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP1, GX_TEV_SWAP1);
|
||||
GXSetTevColor(GX_TEVREG2, mMonoColor);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_OR);
|
||||
filterQuad(1);
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
enum PassID { Pass0, Pass1, Pass2 };
|
||||
|
||||
GXCreateFrameBuffer(width, height);
|
||||
|
||||
GXSetNumTevStages(3);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_TEXC, GX_CC_TEXA, GX_CC_HALF, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP1, GX_TEV_SWAP1);
|
||||
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_TEXC, GX_CC_CPREV, GX_CC_HALF, GX_CC_C0);
|
||||
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevSwapMode(GX_TEVSTAGE1, GX_TEV_SWAP3, GX_TEV_SWAP3);
|
||||
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE2, GX_CC_ZERO, GX_CC_TEXC, GX_CC_CPREV, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE2, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetBlendMode(GX_BM_NONE, GX_BL_ZERO, GX_BL_ZERO, GX_LO_OR);
|
||||
GXColorS10 tevColor0 = {(s16)-mPoint, (s16)-mPoint, (s16)-mPoint, 0x40};
|
||||
GXSetTevColorS10(GX_TEVREG0, tevColor0);
|
||||
GXColor tevColor1 = {mBlureRatio, mBlureRatio, mBlureRatio, mBlureRatio};
|
||||
GXSetTevColor(GX_TEVREG1, tevColor1);
|
||||
GXPixModeSync();
|
||||
filterQuad(2);
|
||||
|
||||
GXSetTevSwapModeTable(GX_TEV_SWAP1, GX_CH_RED, GX_CH_RED, GX_CH_RED, GX_CH_ALPHA);
|
||||
GXSetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0);
|
||||
GXSetTevSwapMode(GX_TEVSTAGE1, GX_TEV_SWAP0, GX_TEV_SWAP0);
|
||||
|
||||
// Downsample and filter from 1/2 EFB into 1/4.
|
||||
TGXTexObj tmpTex[3];
|
||||
GXSetTexCopySrc(0, 0, width / 2, height / 2);
|
||||
CopyToTexObj(&tmpTex[0], Pass0, width / 4, height / 4);
|
||||
GXLoadTexObj(&tmpTex[0], GX_TEXMAP0);
|
||||
|
||||
GXSetNumTexGens(8);
|
||||
u32 texMtxID = GX_TEXMTX0;
|
||||
int angle = 0;
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
for (int texCoord = (int)GX_TEXCOORD1; texCoord < (int)GX_MAX_TEXCOORD; texCoord++) {
|
||||
GXSetTexCoordGen((GXTexCoordID)texCoord, GX_TG_MTX2x4, GX_TG_TEX0, texMtxID);
|
||||
|
||||
f32 dVar15 = mBlureSize * ((448.0f / getHeight()) / 6400.0f);
|
||||
|
||||
mDoMtx_stack_c::transS((dVar15 * cM_scos(angle)) * getInvScale(),
|
||||
dVar15 * cM_ssin(angle), 0.0f);
|
||||
GXLoadTexMtxImm(mDoMtx_stack_c::get(), texMtxID, GX_MTX2x4);
|
||||
|
||||
texMtxID += 3;
|
||||
angle += 0x2492;
|
||||
}
|
||||
|
||||
GXSetNumTevStages(8);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_A1, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
for (int tevStage = (int)GX_TEVSTAGE1; tevStage < 8; tevStage++) {
|
||||
GXSetTevOrder((GXTevStageID)tevStage, (GXTexCoordID)tevStage, GX_TEXMAP0,
|
||||
GX_COLOR_NULL);
|
||||
GXSetTevColorIn((GXTevStageID)tevStage, GX_CC_ZERO, GX_CC_TEXC, GX_CC_A1, GX_CC_CPREV);
|
||||
GXSetTevColorOp((GXTevStageID)tevStage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE,
|
||||
GX_TEVPREV);
|
||||
GXSetTevAlphaIn((GXTevStageID)tevStage, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0);
|
||||
GXSetTevAlphaOp((GXTevStageID)tevStage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE,
|
||||
GX_TEVPREV);
|
||||
}
|
||||
GXPixModeSync();
|
||||
|
||||
// Blur filter from tmp_tex1 1/4 to EFB 1/4.
|
||||
filterQuad(4);
|
||||
|
||||
GXSetTexCopySrc(0, 0, width / 4, height / 4);
|
||||
CopyToTexObj(&tmpTex[1], Pass1, width / 8, height / 8);
|
||||
GXLoadTexObj(&tmpTex[1], GX_TEXMAP0);
|
||||
|
||||
// Upsample 1/8 buffer back up to 1/4 buffer.
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_OR);
|
||||
GXPixModeSync();
|
||||
GXInvalidateTexAll();
|
||||
filterQuad(4);
|
||||
|
||||
// Now that we've upsampled and filtered our final bloom, copy 1/4 buffer.
|
||||
GXSetTexCopySrc(0, 0, width / 4, height / 4);
|
||||
CopyToTexObj(&tmpTex[2], Pass2, width / 4, height / 4);
|
||||
GXLoadTexObj(&tmpTex[2], GX_TEXMAP0);
|
||||
|
||||
GXRestoreFrameBuffer();
|
||||
|
||||
// Now blend our bloom into the real FB.
|
||||
GXSetTevColor(GX_TEVREG0, mBlendColor);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_C0, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetBlendMode(GX_BM_BLEND, mMode == 1 ? GX_BL_INVDSTCLR : GX_BL_ONE, GX_BL_SRCALPHA, GX_LO_OR);
|
||||
GXPixModeSync();
|
||||
GXInvalidateTexAll();
|
||||
filterQuad(1);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void mDoGph_gInf_c::bloom_c::draw() {
|
||||
bool enabled = mEnable && m_buffer != NULL;
|
||||
if (mMonoColor.a != 0 || enabled) {
|
||||
#if TARGET_PC
|
||||
@@ -1376,24 +1558,20 @@ void mDoGph_gInf_c::bloom_c::draw() {
|
||||
GXLoadTexObj(&tmp_tex1, GX_TEXMAP0);
|
||||
|
||||
GXSetNumTexGens(8);
|
||||
u32 iVar11 = 0x1e;
|
||||
int sVar10 = 0;
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x3c);
|
||||
u32 texMtxID = GX_TEXMTX0;
|
||||
int angle = 0;
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
for (int texCoord = (int)GX_TEXCOORD1; texCoord < (int)GX_MAX_TEXCOORD; texCoord++) {
|
||||
GXSetTexCoordGen((GXTexCoordID)texCoord, GX_TG_MTX2x4, GX_TG_TEX0, iVar11);
|
||||
GXSetTexCoordGen((GXTexCoordID)texCoord, GX_TG_MTX2x4, GX_TG_TEX0, texMtxID);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 dVar15 = mBlureSize * ((448.0f / getHeight()) / 6400.0f);
|
||||
#else
|
||||
f32 dVar15 = mBlureSize * (1.0f / 6400.0f);
|
||||
#endif
|
||||
|
||||
mDoMtx_stack_c::transS((dVar15 * cM_scos(sVar10)) * getInvScale(),
|
||||
dVar15 * cM_ssin(sVar10), 0.0f);
|
||||
GXLoadTexMtxImm(mDoMtx_stack_c::get(), iVar11, GX_MTX2x4);
|
||||
mDoMtx_stack_c::transS((dVar15 * cM_scos(angle)) * getInvScale(),
|
||||
dVar15 * cM_ssin(angle), 0.0f);
|
||||
GXLoadTexMtxImm(mDoMtx_stack_c::get(), texMtxID, GX_MTX2x4);
|
||||
|
||||
iVar11 += 3;
|
||||
sVar10 += 0x2492;
|
||||
texMtxID += 3;
|
||||
angle += 0x2492;
|
||||
}
|
||||
GXSetNumTevStages(8);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
@@ -1495,6 +1673,7 @@ void mDoGph_gInf_c::bloom_c::draw() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void retry_captue_frame(view_class* param_0, view_port_class* param_1, int param_2) {
|
||||
UNUSED(param_0);
|
||||
@@ -1858,7 +2037,7 @@ int mDoGph_Painter() {
|
||||
JPADrawInfo draw_info(camera_p->view.viewMtx, camera_p->view.fovy, camera_p->view.aspect);
|
||||
#endif
|
||||
|
||||
#if WIDESCREEN_SUPPORT
|
||||
#if 0 && WIDESCREEN_SUPPORT
|
||||
if (mDoGph_gInf_c::isWideZoom()) {
|
||||
Mtx44 sp140;
|
||||
draw_info.getPrjMtx(sp140);
|
||||
|
||||
Reference in New Issue
Block a user