diff --git a/README.md b/README.md index 2e8c7de7..c06db115 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ Progress | Decompiled | Matched | Linked | Data | |:---:|:---:|:---:|:---:| -| 99.36% | 87.01% | 61.41% | 91.14% | +| 99.36% | 87.05% | 61.41% | 91.14% | -units 914/1027 complete, functions 12190/12563 matched. +units 914/1027 complete, functions 12192/12563 matched. decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data diff --git a/src/scene/address/iplAddress.cpp b/src/scene/address/iplAddress.cpp index 2f4781ba..9ebd2dff 100644 --- a/src/scene/address/iplAddress.cpp +++ b/src/scene/address/iplAddress.cpp @@ -327,15 +327,20 @@ namespace ipl { mpDialogLayout->calc(); } + static inline math::VEC2 scaledPageOffset(f32 scale) { + math::VEC2 result; + result.y = sPageOffset.y * scale; + result.x = sPageOffset.x * scale; + return result; + } + void Address::draw() { if (System::getSceneManager()->onDrawLayer(DRAW_LAYER_2)) { utility::Graphics::setOrtho(0); nw4r::lyt::Pane* pane = mpLayout->FindPaneByName("N_note_a"); for (int i = mNextPageNum; i >= 1; i--) { - math::VEC2 trans; - trans.y = sPageOffset.y * i; - trans.x = sPageOffset.x * i; + math::VEC2 trans = scaledPageOffset(i); pane->SetTranslate(trans); pane->CalculateMtx(*mpLayout->getDrawInfo()); mpLayout->draw(pane); @@ -587,10 +592,20 @@ namespace ipl { } } + static inline nw4r::math::_VEC2 previousPageOffset() { + f32 negativeY = -sPageOffset.y; + f32 negativeX = -sPageOffset.x; + nw4r::math::_VEC2 result; + result.y = negativeY; + result.x = negativeX; + return result; + } + void Address::stt_backward() { if (!mpLayout->getAnim(5)->isPlaying()) { mNextPageNum++; - add_translate(mpLayout->FindPaneByName("N_note_base"), -sPageOffset); + math::VEC2 offset = previousPageOffset(); + add_translate(mpLayout->FindPaneByName("N_note_base"), offset); set_page_text("T_nmbr_b", mPage + 1); for (u32 i = 0; i < BTN_MAX; i++) {