mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-08 13:46:21 -04:00
i_lamp -> i_this
This commit is contained in:
+69
-69
@@ -45,100 +45,100 @@ static const float partHeightOffset = 20.0f;
|
||||
static const float partMaxFlickerPerTick = 0.02f;
|
||||
|
||||
/* 000000EC-00000158 .text daLamp_Draw__FP10lamp_class */
|
||||
static BOOL daLamp_Draw(lamp_class* i_lamp) {
|
||||
g_env_light.settingTevStruct(TEV_TYPE_BG0, &i_lamp->current.pos, &i_lamp->mTevStr);
|
||||
J3DModel* pModel = i_lamp->mModel;
|
||||
g_env_light.setLightTevColorType(pModel, &i_lamp->mTevStr);
|
||||
static BOOL daLamp_Draw(lamp_class* i_this) {
|
||||
g_env_light.settingTevStruct(TEV_TYPE_BG0, &i_this->current.pos, &i_this->mTevStr);
|
||||
J3DModel* pModel = i_this->mModel;
|
||||
g_env_light.setLightTevColorType(pModel, &i_this->mTevStr);
|
||||
mDoExt_modelUpdateDL(pModel);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000158-000005C8 .text daLamp_Execute__FP10lamp_class */
|
||||
static BOOL daLamp_Execute(lamp_class* i_lamp) {
|
||||
i_lamp->mCycleCtr += 1;
|
||||
MtxTrans(i_lamp->current.pos.x, i_lamp->current.pos.y, i_lamp->current.pos.z, 0);
|
||||
mDoMtx_YrotM(*calc_mtx, i_lamp->current.angle.GetY());
|
||||
if (i_lamp->mParameters == 0) {
|
||||
i_lamp->mLength = 0.1f;
|
||||
static BOOL daLamp_Execute(lamp_class* i_this) {
|
||||
i_this->mCycleCtr += 1;
|
||||
MtxTrans(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z, 0);
|
||||
mDoMtx_YrotM(*calc_mtx, i_this->current.angle.GetY());
|
||||
if (i_this->mParameters == 0) {
|
||||
i_this->mLength = 0.1f;
|
||||
} else {
|
||||
if (dComIfGp_getVibration().CheckQuake() || fopAcM_otoCheck(i_lamp, 1000.0f) > 400) {
|
||||
i_lamp->mOto = 0x14;
|
||||
if (dComIfGp_getVibration().CheckQuake() || fopAcM_otoCheck(i_this, 1000.0f) > 400) {
|
||||
i_this->mOto = 0x14;
|
||||
}
|
||||
if (i_lamp->mOto) {
|
||||
i_lamp->mOto--;
|
||||
cLib_addCalc2(&i_lamp->mLength, 0.15f, 1.0f, 0.015f);
|
||||
if (i_this->mOto) {
|
||||
i_this->mOto--;
|
||||
cLib_addCalc2(&i_this->mLength, 0.15f, 1.0f, 0.015f);
|
||||
} else {
|
||||
cLib_addCalc2(&i_lamp->mLength, 0.01f, 1.0f, 0.0005f);
|
||||
cLib_addCalc2(&i_this->mLength, 0.01f, 1.0f, 0.0005f);
|
||||
}
|
||||
}
|
||||
f32 oppDist = cM_ssin(i_lamp->mCycleCtr * 0x320) * i_lamp->mLength;
|
||||
f32 oppDist = cM_ssin(i_this->mCycleCtr * 0x320) * i_this->mLength;
|
||||
MtxRotX(oppDist, 1);
|
||||
f32 adjDist = cM_scos(i_lamp->mCycleCtr * 0x2bc) * i_lamp->mLength;
|
||||
f32 adjDist = cM_scos(i_this->mCycleCtr * 0x2bc) * i_this->mLength;
|
||||
MtxRotZ(adjDist, 1);
|
||||
MtxScale(0.4f, 0.4f, 0.4f, 1);
|
||||
i_lamp->mModel->setBaseTRMtx(*calc_mtx);
|
||||
i_this->mModel->setBaseTRMtx(*calc_mtx);
|
||||
MtxTrans(10.0f, -140.0f, -15.0f, 1);
|
||||
|
||||
cXyz pos;
|
||||
pos.z = 0.0f;
|
||||
pos.y = 0.0f;
|
||||
pos.x = 0.0f;
|
||||
MtxPosition(&pos, &i_lamp->mPos);
|
||||
MtxPosition(&pos, &i_this->mPos);
|
||||
|
||||
if (!i_lamp->mParticleInit) {
|
||||
if (!i_this->mParticleInit) {
|
||||
static cXyz fire_scale(0.5f, 0.5f, 0.5f);
|
||||
|
||||
dComIfGp_particle_set(0x1ea, &i_lamp->mPos, NULL, &fire_scale, 0xFF, &i_lamp->mPa);
|
||||
i_lamp->mParticleInit = 1;
|
||||
i_lamp->mParticlePower = 1.0f;
|
||||
dComIfGp_particle_set(0x1ea, &i_this->mPos, NULL, &fire_scale, 0xFF, &i_this->mPa);
|
||||
i_this->mParticleInit = 1;
|
||||
i_this->mParticlePower = 1.0f;
|
||||
}
|
||||
|
||||
if (i_lamp->mPa.getEmitter()) {
|
||||
cXyz whitePartPos = i_lamp->mPos;
|
||||
if (i_this->mPa.getEmitter()) {
|
||||
cXyz whitePartPos = i_this->mPos;
|
||||
whitePartPos.y += partHeightOffset;
|
||||
dComIfGp_particle_setSimple(0x4004, &whitePartPos, 0xFF, g_whiteColor, g_whiteColor, 0);
|
||||
cLib_addCalc2(&i_lamp->mParticlePower, cM_rndF(0.2f) + 1.0f, 0.5f, partMaxFlickerPerTick);
|
||||
cLib_addCalc2(&i_this->mParticlePower, cM_rndF(0.2f) + 1.0f, 0.5f, partMaxFlickerPerTick);
|
||||
} else {
|
||||
i_lamp->mParticlePower = 0.0f;
|
||||
i_this->mParticlePower = 0.0f;
|
||||
}
|
||||
i_lamp->mInf.mPos = i_lamp->mPos;
|
||||
i_lamp->mInf.mColor.r = 600;
|
||||
i_lamp->mInf.mColor.g = 400;
|
||||
i_lamp->mInf.mColor.b = 120;
|
||||
i_this->mInf.mPos = i_this->mPos;
|
||||
i_this->mInf.mColor.r = 600;
|
||||
i_this->mInf.mColor.g = 400;
|
||||
i_this->mInf.mColor.b = 120;
|
||||
|
||||
s16 power = i_lamp->mParticlePower * 150.0f;
|
||||
i_lamp->mInf.mPower = power;
|
||||
i_lamp->mInf.mFluctuation = 250.0f;
|
||||
s16 power = i_this->mParticlePower * 150.0f;
|
||||
i_this->mInf.mPower = power;
|
||||
i_this->mInf.mFluctuation = 250.0f;
|
||||
|
||||
i_lamp->mSph.SetC(i_lamp->mPos);
|
||||
dComIfG_Ccsp()->Set(&i_lamp->mSph);
|
||||
if (!i_lamp->mHitTimeoutLeft) {
|
||||
if (i_lamp->mSph.ChkTgHit()) {
|
||||
cCcD_Obj* pHitObj = i_lamp->mSph.GetTgHitObj();
|
||||
i_this->mSph.SetC(i_this->mPos);
|
||||
dComIfG_Ccsp()->Set(&i_this->mSph);
|
||||
if (!i_this->mHitTimeoutLeft) {
|
||||
if (i_this->mSph.ChkTgHit()) {
|
||||
cCcD_Obj* pHitObj = i_this->mSph.GetTgHitObj();
|
||||
if (pHitObj && pHitObj->ChkAtType(AT_TYPE_LEAF_WIND | AT_TYPE_UNK400000)) {
|
||||
i_lamp->mHitAngle = dComIfGp_getPlayer(0)->shape_angle.y;
|
||||
i_lamp->mHitTimeoutLeft = 0x28;
|
||||
i_this->mHitAngle = dComIfGp_getPlayer(0)->shape_angle.y;
|
||||
i_this->mHitTimeoutLeft = 0x28;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
i_lamp->mHitTimeoutLeft--;
|
||||
if (i_lamp->mPa.mpEmitter) {
|
||||
i_this->mHitTimeoutLeft--;
|
||||
if (i_this->mPa.mpEmitter) {
|
||||
float tgtZ;
|
||||
if (i_lamp->mHitTimeoutLeft > 10) {
|
||||
if (i_this->mHitTimeoutLeft > 10) {
|
||||
tgtZ = 4.0f;
|
||||
} else {
|
||||
tgtZ = 0.0f;
|
||||
}
|
||||
cLib_addCalc2(&i_lamp->mHitReactCurZ, tgtZ, 1.0f, 0.5f);
|
||||
cMtx_YrotS(*calc_mtx, i_lamp->mHitAngle);
|
||||
cLib_addCalc2(&i_this->mHitReactCurZ, tgtZ, 1.0f, 0.5f);
|
||||
cMtx_YrotS(*calc_mtx, i_this->mHitAngle);
|
||||
cXyz localPos;
|
||||
localPos.set(0.0f, 1.0f, i_lamp->mHitReactCurZ);
|
||||
localPos.set(0.0f, 1.0f, i_this->mHitReactCurZ);
|
||||
cXyz globalPos;
|
||||
MtxPosition(&localPos, &globalPos);
|
||||
float y = globalPos.y;
|
||||
float z = globalPos.z;
|
||||
float x = globalPos.x;
|
||||
i_lamp->mPa.mpEmitter->mEmitterDir.set(x, y, z);
|
||||
i_this->mPa.mpEmitter->mEmitterDir.set(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,25 +146,25 @@ static BOOL daLamp_Execute(lamp_class* i_lamp) {
|
||||
}
|
||||
|
||||
/* 00000604-00000634 .text daLamp_IsDelete__FP10lamp_class */
|
||||
static BOOL daLamp_IsDelete(lamp_class* i_lamp) {
|
||||
i_lamp->mPa.end();
|
||||
static BOOL daLamp_IsDelete(lamp_class* i_this) {
|
||||
i_this->mPa.end();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000634-00000678 .text daLamp_Delete__FP10lamp_class */
|
||||
static BOOL daLamp_Delete(lamp_class* i_lamp) {
|
||||
dComIfG_resDelete(&i_lamp->mPhs, "Lamp");
|
||||
dKy_plight_cut(&i_lamp->mInf);
|
||||
static BOOL daLamp_Delete(lamp_class* i_this) {
|
||||
dComIfG_resDelete(&i_this->mPhs, "Lamp");
|
||||
dKy_plight_cut(&i_this->mInf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000678-0000073C .text useHeapInit__FP10lamp_class */
|
||||
static BOOL useHeapInit(lamp_class* i_lamp) {
|
||||
static BOOL useHeapInit(lamp_class* i_this) {
|
||||
J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Lamp", 3));
|
||||
JUT_ASSERT(0x170, modelData != 0);
|
||||
|
||||
i_lamp->mModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
|
||||
if (i_lamp->mModel == 0) {
|
||||
i_this->mModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
|
||||
if (i_this->mModel == 0) {
|
||||
return FALSE;
|
||||
} else {
|
||||
return TRUE;
|
||||
@@ -179,26 +179,26 @@ static BOOL daLamp_solidHeapCB(fopAc_ac_c* i_ac) {
|
||||
/* 0000075C-00000914 .text daLamp_Create__FP10fopAc_ac_c */
|
||||
static int daLamp_Create(fopAc_ac_c* i_ac) {
|
||||
fopAcM_SetupActor(i_ac, lamp_class);
|
||||
lamp_class* i_lamp = (lamp_class*)i_ac;
|
||||
lamp_class* i_this = (lamp_class*)i_ac;
|
||||
|
||||
s32 phase_state = dComIfG_resLoad(&i_lamp->mPhs, "Lamp");
|
||||
s32 phase_state = dComIfG_resLoad(&i_this->mPhs, "Lamp");
|
||||
if (phase_state == cPhs_COMPLEATE_e) {
|
||||
if (fopAcM_entrySolidHeap(i_lamp, (heapCallbackFunc)&daLamp_solidHeapCB, 0x6040)) {
|
||||
i_lamp->mParameters = fopAcM_GetParam(i_lamp);
|
||||
if (i_lamp->mParameters == 0xFF) {
|
||||
i_lamp->mParameters = 0;
|
||||
if (fopAcM_entrySolidHeap(i_this, (heapCallbackFunc)&daLamp_solidHeapCB, 0x6040)) {
|
||||
i_this->mParameters = fopAcM_GetParam(i_this);
|
||||
if (i_this->mParameters == 0xFF) {
|
||||
i_this->mParameters = 0;
|
||||
}
|
||||
i_lamp->mStts.Init(0xff, 0xff, i_lamp);
|
||||
i_lamp->mSph.Set(sph_src);
|
||||
i_lamp->mSph.SetStts(&i_lamp->mStts);
|
||||
i_this->mStts.Init(0xff, 0xff, i_this);
|
||||
i_this->mSph.Set(sph_src);
|
||||
i_this->mSph.SetStts(&i_this->mStts);
|
||||
|
||||
i_lamp->mCycleCtr = cM_rndFX(32768.0f);
|
||||
i_this->mCycleCtr = cM_rndFX(32768.0f);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
daLamp_Execute(i_lamp);
|
||||
daLamp_Execute(i_this);
|
||||
}
|
||||
|
||||
dKy_plight_set(&i_lamp->mInf);
|
||||
dKy_plight_set(&i_this->mInf);
|
||||
} else {
|
||||
phase_state = cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user