diff options
| author | Kenix3 <kenixwhisperwind@gmail.com> | 2022-08-03 23:18:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-03 23:18:24 -0400 |
| commit | 5f913cb9bf93fa4a7fd5d1fb7de68b9b61c525ee (patch) | |
| tree | 22531a89b092cffabc32bec37e77d6fb5c2edb08 /soh/src/code | |
| parent | bd86c792c371356d6a4e4eca4ab60c1209a75d44 (diff) | |
| parent | 739434e3e4314f6071404d19b87b5466e0f5334e (diff) | |
Merge pull request #1037 from briaguya-ai/rachael-to-zhora
Rachael to zhora
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/speed_meter.c | 4 | ||||
| -rw-r--r-- | soh/src/code/z_actor.c | 4 | ||||
| -rw-r--r-- | soh/src/code/z_eff_shield_particle.c | 7 | ||||
| -rw-r--r-- | soh/src/code/z_eff_spark.c | 6 | ||||
| -rw-r--r-- | soh/src/code/z_kankyo.c | 28 | ||||
| -rw-r--r-- | soh/src/code/z_lifemeter.c | 7 | ||||
| -rw-r--r-- | soh/src/code/z_parameter.c | 16 | ||||
| -rw-r--r-- | soh/src/code/z_play.c | 3 |
8 files changed, 64 insertions, 11 deletions
diff --git a/soh/src/code/speed_meter.c b/soh/src/code/speed_meter.c index f645c7bb5..800eef0f0 100644 --- a/soh/src/code/speed_meter.c +++ b/soh/src/code/speed_meter.c @@ -55,13 +55,13 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) { uly = this->y; lry = this->y + 2; - OPEN_DISPS(gfxCtx); - /*! @bug if gIrqMgrRetraceTime is 0, CLOSE_DISPS will never be reached */ if (gIrqMgrRetraceTime == 0) { return; } + OPEN_DISPS(gfxCtx); + sSpeedMeterTimeEntryPtr = &sSpeedMeterTimeEntryArray[0]; for (i = 0; i < ARRAY_COUNT(sSpeedMeterTimeEntryArray); i++) { temp = ((f64) * (sSpeedMeterTimeEntryPtr->time) / gIrqMgrRetraceTime) * 64.0; diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index fff93a560..b96978620 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -3957,6 +3957,8 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { f32 chainsTranslateX; f32 chainsTranslateY; f32 rotZStep; + static s32 epoch = 0; + epoch++; entry = &sDoorLocksInfo[type]; chainRotZ = entry->chainsRotZInit; @@ -3970,6 +3972,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { chainsTranslateY = cosf(entry->chainAngle - chainRotZ) * (10 - frame) * 0.1f * entry->chainLength; for (i = 0; i < 4; i++) { + FrameInterpolation_RecordOpenChild(entry, epoch + i * 25); Matrix_Put(&baseMtxF); Matrix_RotateZ(chainRotZ, MTXMODE_APPLY); Matrix_Translate(chainsTranslateX, chainsTranslateY, 0.0f, MTXMODE_APPLY); @@ -3989,6 +3992,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { } chainRotZ += rotZStep; + FrameInterpolation_RecordCloseChild(); } Matrix_Put(&baseMtxF); diff --git a/soh/src/code/z_eff_shield_particle.c b/soh/src/code/z_eff_shield_particle.c index a5d9ca53f..27032a632 100644 --- a/soh/src/code/z_eff_shield_particle.c +++ b/soh/src/code/z_eff_shield_particle.c @@ -47,6 +47,7 @@ void EffectShieldParticle_Init(void* thisx, void* initParamsx) { elem->endXChange = elem->initialSpeed; elem->yaw = Rand_ZeroOne() * 65534.0f; elem->pitch = Rand_ZeroOne() * 65534.0f; + elem->epoch++; } this->lightDecay = initParams->lightDecay; @@ -156,7 +157,6 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { Color_RGBA8 primColor; Color_RGBA8 envColor; - FrameInterpolation_RecordOpenChild(this, 0); OPEN_DISPS(gfxCtx); if (this != NULL) { @@ -182,6 +182,8 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_XLU_DISP++); for (elem = &this->elements[0]; elem < &this->elements[this->numElements]; elem++) { + FrameInterpolation_RecordOpenChild(elem, elem->epoch); + Mtx* mtx; MtxF sp104; MtxF spC4; @@ -212,9 +214,10 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(POLY_XLU_DISP++, sVertices, 4, 0); gSP2Triangles(POLY_XLU_DISP++, 0, 1, 2, 0, 0, 3, 1, 0); + + FrameInterpolation_RecordCloseChild(); } } CLOSE_DISPS(gfxCtx); - FrameInterpolation_RecordCloseChild(); } diff --git a/soh/src/code/z_eff_spark.c b/soh/src/code/z_eff_spark.c index 445fd7fea..5ce627508 100644 --- a/soh/src/code/z_eff_spark.c +++ b/soh/src/code/z_eff_spark.c @@ -89,6 +89,7 @@ void EffectSpark_Init(void* thisx, void* initParamsx) { elem->unkPosition.x = Rand_ZeroOne() * 65534.0f; elem->unkPosition.y = Rand_ZeroOne() * 65534.0f; elem->unkPosition.z = Rand_ZeroOne() * 65534.0f; + elem->epoch++; } this->timer = 0; @@ -210,6 +211,8 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { Mtx* mtx; f32 temp; + FrameInterpolation_RecordOpenChild(elem, elem->epoch); + SkinMatrix_SetTranslate(&spEC, elem->position.x, elem->position.y, elem->position.z); temp = ((Rand_ZeroOne() * 2.5f) + 1.5f) / 64.0f; SkinMatrix_SetScale(&spAC, temp, temp, 1.0f); @@ -264,6 +267,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp12C); if (mtx == NULL) { + FrameInterpolation_RecordCloseChild(); goto end; } @@ -273,6 +277,8 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { } gDPPipeSync(POLY_XLU_DISP++); + + FrameInterpolation_RecordCloseChild(); } end: diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index de654dfbb..de8634f32 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -3,6 +3,7 @@ #include "vt.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" +#include "soh/frame_interpolation.h" typedef enum { /* 0 */ LENS_FLARE_CIRCLE0, @@ -950,7 +951,6 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li Gfx* prevDisplayList; OPEN_DISPS(globalCtx->state.gfxCtx); - prevDisplayList = POLY_OPA_DISP; displayList = Graph_GfxPlusOne(POLY_OPA_DISP); gSPDisplayList(OVERLAY_DISP++, displayList); @@ -1459,6 +1459,8 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env LENS_FLARE_RING, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, }; + static s32 epoch = 0; + epoch++; OPEN_DISPS(gfxCtx); @@ -1502,9 +1504,7 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env unk88Target = cosAngle; } - if (cosAngle < 0.0f) { - - } else { + if (!(cosAngle < 0.0f)) { if (arg9) { u32 shrink = ShrinkWindow_GetCurrentVal(); func_800C016C(globalCtx, &pos, &screenPos); @@ -1517,6 +1517,8 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env } for (i = 0; i < ARRAY_COUNT(lensFlareTypes); i++) { + FrameInterpolation_RecordOpenChild("Lens Flare", epoch + i * 25); + Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW); if (arg9) { @@ -1573,6 +1575,8 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env gSPDisplayList(POLY_XLU_DISP++, gLensFlareRingDL); break; } + + FrameInterpolation_RecordCloseChild(); } alphaScale = cosAngle - (1.5f - cosAngle); @@ -1638,6 +1642,8 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* Vec3f unused = { 0.0f, 0.0f, 0.0f }; Vec3f windDirection = { 0.0f, 0.0f, 0.0f }; Player* player = GET_PLAYER(globalCtx); + static s32 epoch = 0; + epoch++; if (!(globalCtx->cameraPtrs[0]->unk_14C & 0x100) && (globalCtx->envCtx.unk_EE[2] == 0)) { OPEN_DISPS(gfxCtx); @@ -1667,6 +1673,8 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* // draw rain drops for (i = 0; i < globalCtx->envCtx.unk_EE[1]; i++) { + FrameInterpolation_RecordOpenChild("Rain Drop", epoch + i * 25); + temp2 = Rand_ZeroOne(); temp1 = Rand_ZeroOne(); temp3 = Rand_ZeroOne(); @@ -1692,6 +1700,8 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gRaindropDL); + + FrameInterpolation_RecordCloseChild(); } // draw droplet rings on the ground @@ -1699,6 +1709,8 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* u8 firstDone = false; for (i = 0; i < globalCtx->envCtx.unk_EE[1]; i++) { + FrameInterpolation_RecordOpenChild("Droplet Ring", epoch + i * 25); + if (!firstDone) { func_80093D84(gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0); @@ -1719,6 +1731,8 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); + + FrameInterpolation_RecordCloseChild(); } } @@ -1911,10 +1925,14 @@ void Environment_DrawLightning(GlobalContext* globalCtx, s32 unused) { s32 pad[2]; Vec3f unused1 = { 0.0f, 0.0f, 0.0f }; Vec3f unused2 = { 0.0f, 0.0f, 0.0f }; + static s32 epoch = 0; + epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(sLightningBolts); i++) { + FrameInterpolation_RecordOpenChild("Lightning Bolt", epoch + i * 25); + switch (sLightningBolts[i].state) { case LIGHTNING_BOLT_START: dx = globalCtx->view.lookAt.x - globalCtx->view.eye.x; @@ -1969,6 +1987,8 @@ void Environment_DrawLightning(GlobalContext* globalCtx, s32 unused) { gSPMatrix(POLY_XLU_DISP++, SEG_ADDR(1, 0), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffLightningDL); } + + FrameInterpolation_RecordCloseChild(); } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index e1bafb3d2..400f0a275 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -1,5 +1,6 @@ #include "global.h" #include "textures/parameter_static/parameter_static.h" +#include "soh/frame_interpolation.h" s16 Top_LM_Margin = 0; s16 Left_LM_Margin = 0; @@ -412,6 +413,8 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { s32 curCombineModeSet = 0; u8* curBgImgLoaded = NULL; s32 ddHeartCountMinusOne = gSaveContext.inventory.defenseHearts - 1; + static s32 epoch = 0; + epoch++; OPEN_DISPS(gfxCtx); @@ -449,6 +452,8 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { } for (i = 0; i < totalHeartCount; i++) { + FrameInterpolation_RecordOpenChild("HealthMeter Heart", epoch + i * 25); + if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { if (i < fullHeartCount) { if (curColorSet != 0) { @@ -624,6 +629,8 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { offsetX = PosX_original; } } + + FrameInterpolation_RecordCloseChild(); } CLOSE_DISPS(gfxCtx); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 44d529587..364e63956 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1384,6 +1384,12 @@ void Inventory_SwapAgeEquipment(void) { u16 temp; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { + // When becoming adult, remove swordless flag since we'll get master sword + // Only in rando to keep swordless link bugs in vanilla + if (gSaveContext.n64ddFlag) { + gSaveContext.infTable[29] &= ~1; + } + for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { if (i != 0) { gSaveContext.childEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; @@ -1444,6 +1450,12 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.equips.equipment = gSaveContext.adultEquips.equipment; } } else { + // When becoming child, set swordless flag if player doesn't have kokiri sword + // Only in rando to keep swordless link bugs in vanilla + if (gSaveContext.n64ddFlag && (1 << 0 & gSaveContext.inventory.equipment) == 0) { + gSaveContext.infTable[29] |= 1; + } + for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; @@ -3352,8 +3364,8 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { const s16 C_Right_BTN_Pos_ori[] = { C_RIGHT_BUTTON_X+X_Margins_CR, C_RIGHT_BUTTON_Y+Y_Margins_CR }; const s16 C_Up_BTN_Pos_ori[] = { C_UP_BUTTON_X+X_Margins_CU, C_UP_BUTTON_Y+Y_Margins_CU }; const s16 C_Down_BTN_Pos_ori[] = { C_DOWN_BUTTON_X+X_Margins_CD, C_DOWN_BUTTON_Y+Y_Margins_CD }; - s16 LabelX_Navi=8; - s16 LabelY_Navi=4 - !!CVar_GetS32("gNaviTextFix", 0); + s16 LabelX_Navi=7 + !!CVar_GetS32("gNaviTextFix", 0); + s16 LabelY_Navi=4; s16 C_Left_BTN_Pos[2]; //(X,Y) s16 C_Right_BTN_Pos[2]; s16 C_Up_BTN_Pos[2]; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index f99979715..8974495fb 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -203,7 +203,8 @@ void GivePlayerRandoRewardSongOfTime(GlobalContext* globalCtx, RandomizerCheck c !Flags_GetTreasure(globalCtx, 0x1F) && gSaveContext.nextTransition == 0xFF) { GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_SONG_OF_TIME); GiveItemWithoutActor(globalCtx, getItemId); - Flags_SetTreasure(globalCtx, 0x1F); + player->pendingFlag.flagID = 0x1F; + player->pendingFlag.flagType = FLAG_SCENE_TREASURE; } } |
