mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-30 08:56:28 -04:00
Add dBgS_AttributeCode enum
This commit is contained in:
@@ -198,6 +198,9 @@ public:
|
||||
void setGlobalDynamicsScale(const JGeometry::TVec3<float>& scale) {
|
||||
mGlobalDynamicsScale.set(scale);
|
||||
}
|
||||
void setEmitterTranslation(const JGeometry::TVec3<float>& trans) {
|
||||
mEmitterTranslation.set(trans);
|
||||
}
|
||||
void setEmitterScale(const JGeometry::TVec3<float>& scale) {
|
||||
mEmitterScale.set(scale);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,41 @@ class dBgS_SphChk;
|
||||
|
||||
class dBgS_Acch;
|
||||
|
||||
enum dBgS_AttributeCode {
|
||||
dBgS_Attr_NORMAL_e = 0x00,
|
||||
dBgS_Attr_DIRT_e = 0x01,
|
||||
dBgS_Attr_WOOD_e = 0x02,
|
||||
dBgS_Attr_STONE_e = 0x03,
|
||||
dBgS_Attr_GRASS_e = 0x04,
|
||||
dBgS_Attr_GIANT_FLOWER_e = 0x05,
|
||||
dBgS_Attr_LAVA_e = 0x06,
|
||||
// dBgS_Attr_UNK07_e = 0x07,
|
||||
dBgS_Attr_VOID_e = 0x08,
|
||||
dBgS_Attr_DAMAGE_e = 0x09,
|
||||
dBgS_Attr_CARPET_e = 0x0A,
|
||||
dBgS_Attr_SAND_e = 0x0B,
|
||||
// dBgS_Attr_UNK0C_e = 0x0C,
|
||||
// dBgS_Attr_UNK0D_e = 0x0D,
|
||||
// dBgS_Attr_UNK0E_e = 0x0E,
|
||||
dBgS_Attr_ICE_e = 0x0F,
|
||||
// dBgS_Attr_UNK10_e = 0x10,
|
||||
// dBgS_Attr_UNK11_e = 0x11,
|
||||
// dBgS_Attr_UNK12_e = 0x12,
|
||||
dBgS_Attr_WATER_e = 0x13,
|
||||
dBgS_Attr_METAL_e = 0x14,
|
||||
dBgS_Attr_FREEZE_e = 0x15,
|
||||
dBgS_Attr_ELECTRICITY_e = 0x16,
|
||||
dBgS_Attr_WATERFALL_e = 0x17,
|
||||
// dBgS_Attr_UNK18_e = 0x18,
|
||||
// dBgS_Attr_UNK19_e = 0x19,
|
||||
// dBgS_Attr_UNK1A_e = 0x1A,
|
||||
dBgS_Attr_UNK1B_e = 0x1B,
|
||||
// dBgS_Attr_UNK1C_e = 0x1C,
|
||||
// dBgS_Attr_UNK1D_e = 0x1D,
|
||||
// dBgS_Attr_UNK1E_e = 0x1E,
|
||||
// dBgS_Attr_UNK1F_e = 0x1F,
|
||||
};
|
||||
|
||||
class dBgS : public cBgS {
|
||||
public:
|
||||
dBgS() {}
|
||||
|
||||
@@ -821,7 +821,13 @@ BOOL daArrow_c::procMove() {
|
||||
s32 attribCode = dComIfG_Bgsp()->GetAttributeCode(mLinChk);
|
||||
s32 mtrlSndId = dComIfG_Bgsp()->GetMtrlSndId(mLinChk);
|
||||
|
||||
if (mArrowType == TYPE_NORMAL && (attribCode == 0x3 || attribCode == 0x14 || attribCode == 0xF || attribCode == 0x9 || attribCode == 0x15)) {
|
||||
if (mArrowType == TYPE_NORMAL && (
|
||||
attribCode == dBgS_Attr_STONE_e ||
|
||||
attribCode == dBgS_Attr_METAL_e ||
|
||||
attribCode == dBgS_Attr_ICE_e ||
|
||||
attribCode == dBgS_Attr_DAMAGE_e ||
|
||||
attribCode == dBgS_Attr_FREEZE_e
|
||||
)) {
|
||||
mCurrProcFunc = &procReturn;
|
||||
fopAcM_SetParam(this, 3);
|
||||
speed *= -0.1f;
|
||||
|
||||
@@ -4108,7 +4108,7 @@ BOOL daPy_lk_c::checkLavaFace(cXyz* param_1, int attributeCode) {
|
||||
}
|
||||
}
|
||||
|
||||
if (attributeCode == 6) {
|
||||
if (attributeCode == dBgS_Attr_LAVA_e) {
|
||||
if (param_1) {
|
||||
current.pos.y = m35D4;
|
||||
}
|
||||
@@ -4117,7 +4117,7 @@ BOOL daPy_lk_c::checkLavaFace(cXyz* param_1, int attributeCode) {
|
||||
} else {
|
||||
return dProcLavaDamage_init();
|
||||
}
|
||||
} else if (attributeCode == 8) {
|
||||
} else if (attributeCode == dBgS_Attr_VOID_e) {
|
||||
startRestartRoom(5, 0xC9, -1.0f, 0);
|
||||
}
|
||||
|
||||
|
||||
+10
-11
@@ -13,24 +13,22 @@
|
||||
namespace daObj {
|
||||
/* 800666EC-800668BC .text make_land_effect__5daObjFP10fopAc_ac_cP11dBgS_GndChkf */
|
||||
void make_land_effect(fopAc_ac_c* ac, dBgS_GndChk* chk, f32 scale) {
|
||||
/* Nonmatching */
|
||||
cXyz scaleV;
|
||||
switch (dComIfG_Bgsp()->GetAttributeCode(*chk)) {
|
||||
case 19:
|
||||
case dBgS_Attr_WATER_e:
|
||||
{
|
||||
cXyz scaleV;
|
||||
scaleV.setall(scale * 0.85f);
|
||||
JPABaseEmitter* pEmtr = dComIfGp_particle_set(0x23, &ac->current.pos, NULL, &scaleV);
|
||||
if (pEmtr != NULL) {
|
||||
pEmtr->setRate(50.0f);
|
||||
pEmtr->setRate(20.0f);
|
||||
pEmtr->setMaxFrame(1);
|
||||
pEmtr->setSpread(1.0f);
|
||||
pEmtr->setDirectionalSpeed(12.0f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case dBgS_Attr_GRASS_e:
|
||||
{
|
||||
cXyz scaleV;
|
||||
scaleV.setall(scale);
|
||||
JPABaseEmitter* pEmtr = dComIfGp_particle_set(0x24, &ac->current.pos, NULL, &scaleV);
|
||||
if (pEmtr != NULL) {
|
||||
@@ -39,14 +37,15 @@ namespace daObj {
|
||||
pEmtr->setMaxFrame(1);
|
||||
pEmtr->setSpread(1.0f);
|
||||
pEmtr->setDirectionalSpeed(20.0f);
|
||||
pEmtr->setGlobalTranslation(cXyz(0.0f, 5.0f, 0.0f));
|
||||
JGeometry::TVec3<f32> trans(0.0f, 5.0f, 0.0f);
|
||||
pEmtr->setEmitterTranslation(trans);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case 10:
|
||||
case 15:
|
||||
case 27:
|
||||
case dBgS_Attr_GIANT_FLOWER_e:
|
||||
case dBgS_Attr_CARPET_e:
|
||||
case dBgS_Attr_ICE_e:
|
||||
case dBgS_Attr_UNK1B_e:
|
||||
break;
|
||||
default:
|
||||
{
|
||||
|
||||
+33
-5
@@ -182,16 +182,44 @@ s32 dBgS::GetAttributeCodeDirect(cBgS_PolyInfo& polyInfo) {
|
||||
}
|
||||
|
||||
static s32 atr_conv[0x20] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x01,
|
||||
0x08, 0x09, 0x0A, 0x0B, 0x02, 0x02, 0x02, 0x0F,
|
||||
0x02, 0x14, 0x01, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x14, 0x0A, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/* 0x00 */ dBgS_Attr_NORMAL_e,
|
||||
/* 0x01 */ dBgS_Attr_DIRT_e,
|
||||
/* 0x02 */ dBgS_Attr_WOOD_e,
|
||||
/* 0x03 */ dBgS_Attr_STONE_e,
|
||||
/* 0x04 */ dBgS_Attr_GRASS_e,
|
||||
/* 0x05 */ dBgS_Attr_GIANT_FLOWER_e,
|
||||
/* 0x06 */ dBgS_Attr_LAVA_e,
|
||||
/* 0x07 */ dBgS_Attr_DIRT_e,
|
||||
/* 0x08 */ dBgS_Attr_VOID_e,
|
||||
/* 0x09 */ dBgS_Attr_DAMAGE_e,
|
||||
/* 0x0A */ dBgS_Attr_CARPET_e,
|
||||
/* 0x0B */ dBgS_Attr_SAND_e,
|
||||
/* 0x0C */ dBgS_Attr_WOOD_e,
|
||||
/* 0x0D */ dBgS_Attr_WOOD_e,
|
||||
/* 0x0E */ dBgS_Attr_WOOD_e,
|
||||
/* 0x0F */ dBgS_Attr_ICE_e,
|
||||
/* 0x10 */ dBgS_Attr_WOOD_e,
|
||||
/* 0x11 */ dBgS_Attr_METAL_e,
|
||||
/* 0x12 */ dBgS_Attr_DIRT_e,
|
||||
/* 0x13 */ dBgS_Attr_WATER_e,
|
||||
/* 0x14 */ dBgS_Attr_METAL_e,
|
||||
/* 0x15 */ dBgS_Attr_FREEZE_e,
|
||||
/* 0x16 */ dBgS_Attr_ELECTRICITY_e,
|
||||
/* 0x17 */ dBgS_Attr_WATERFALL_e,
|
||||
/* 0x18 */ dBgS_Attr_METAL_e,
|
||||
/* 0x19 */ dBgS_Attr_CARPET_e,
|
||||
/* 0x1A */ dBgS_Attr_WOOD_e,
|
||||
/* 0x1B */ dBgS_Attr_NORMAL_e,
|
||||
/* 0x1C */ dBgS_Attr_NORMAL_e,
|
||||
/* 0x1D */ dBgS_Attr_NORMAL_e,
|
||||
/* 0x1E */ dBgS_Attr_NORMAL_e,
|
||||
/* 0x1F */ dBgS_Attr_NORMAL_e,
|
||||
};
|
||||
|
||||
/* 800A0B60-800A0BA8 .text GetAttributeCode__4dBgSFR13cBgS_PolyInfo */
|
||||
s32 dBgS::GetAttributeCode(cBgS_PolyInfo& polyInfo) {
|
||||
s32 attr = GetAttributeCodeDirect(polyInfo);
|
||||
if (!(0 <= attr && attr < 0x20))
|
||||
if (attr < 0 || attr >= (int)ARRAY_SIZE(atr_conv))
|
||||
return 0;
|
||||
return atr_conv[attr];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user