From 4d13ab304b2b8d6323b1cd2144d34a2f70eab3e5 Mon Sep 17 00:00:00 2001 From: "A.C" Date: Thu, 10 Sep 2015 00:06:19 +0900 Subject: [PATCH] fix draw hold body inactive texture bug If hold body, draw texture to the outside screen. --- src/NoteDisplay.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index f024a11de6..6d96580c82 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -756,7 +756,12 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, /* Only draw the section that's within the range specified. If a hold note is * very long, don't process or draw the part outside of the range. Don't change * part_args.y_top or part_args.y_bottom; they need to be left alone to calculate texture coordinates. */ - const float y_start_pos = max(part_args.y_top, part_args.y_start_pos); + // If hold body, draw texture to the outside screen.(fix by A.C) + float y_start_pos = (part_type == hpt_body) ? part_args.y_top : max(part_args.y_top, part_args.y_start_pos); + if (part_args.y_top < part_args.y_start_pos - unzoomed_frame_height) + { + y_start_pos = fmod((y_start_pos - part_args.y_start_pos), unzoomed_frame_height) + part_args.y_start_pos; + } float y_end_pos = min(part_args.y_bottom, part_args.y_end_pos); const float color_scale= glow ? 1 : part_args.color_scale; if(part_type == hpt_body) @@ -787,8 +792,8 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, { /* For very large hold notes, shift the texture coordinates to be near 0, so we * don't send very large values to the renderer. */ - const float fDistFromTop = y_start_pos - part_args.y_top; - float fTexCoordTop = SCALE(fDistFromTop, 0, unzoomed_frame_height, rect.top, rect.bottom); + const float fDistFromTop = y_start_pos - part_args.y_top; + float fTexCoordTop = SCALE(fDistFromTop, 0, unzoomed_frame_height, rect.top, rect.bottom); fTexCoordTop += add_to_tex_coord; add_to_tex_coord -= floorf(fTexCoordTop); } @@ -800,10 +805,8 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, if (!part_args.anchor_to_top) { float offset = unzoomed_frame_height - (y_end_pos - y_start_pos); - // ロングノート本体の長さがunzoomed_frame_height→0のときに、add_to_tex_coordを0→1にすればOK - // つまり、offsetを0→unzoomed_frame_heightにすると理想通りの表示になる -A.C // Shift texture coord to fit hold length If hold length is less than - // bottomcap frame size. (translated by hanubeki) + // bottomcap frame size. (fix by A.C / translated by hanubeki) if (offset>0){ add_to_tex_coord = SCALE(offset, 0.0f, unzoomed_frame_height, 0.0f, 1.0f); }