From 560ac0c3f5fc561a3db490d8f4a33c3e19296083 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 12 Feb 2021 19:07:24 -0500 Subject: Got correct sprites for message arrows --- src/renderer.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/renderer.cpp') diff --git a/src/renderer.cpp b/src/renderer.cpp index 0e77bb9..246b7fb 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -230,28 +230,32 @@ void Renderer::render(Game& game) { // 216, 138, 142 if (game.getSystem().isNextArrowShowing()) { - if (advMsgArrowTex_ == -1) { - advMsgArrowTex_ = loadImageFromFile("../res/advance_text_arrow.png"); - } - if (game.getSystem().isChoiceActive()) { + if (choiceArrowTex_ == -1) { + choiceArrowTex_ = loadImageFromFile("../res/select_choice_arrow.png"); + } + int selection = game.getSystem().getChoiceSelection(); int charIndex = game.getSystem().getLines().back().choicePos[selection]; int baseX = messageLines_[1].charIndexToWidth[charIndex]; SDL_Rect destRect { - 18 + baseX - game.getSystem().getNextArrowBob()-16+3, - 141, - 16, - 16}; + 18 + baseX - game.getSystem().getNextArrowBob()-8, + 144, + 8, + 8 }; - SDL_RenderCopyEx(ren_.get(), textures_.at(advMsgArrowTex_).get(), nullptr, &destRect, -90, nullptr, SDL_FLIP_NONE); + SDL_RenderCopy(ren_.get(), textures_.at(choiceArrowTex_).get(), nullptr, &destRect); } else { + if (advMsgArrowTex_ == -1) { + advMsgArrowTex_ = loadImageFromFile("../res/advance_text_arrow.png"); + } + SDL_Rect destRect { - 216, - 138 + game.getSystem().getNextArrowBob(), - 16, - 16 }; + 220, + 142 + game.getSystem().getNextArrowBob(), + 8, + 8 }; SDL_RenderCopy(ren_.get(), textures_.at(advMsgArrowTex_).get(), nullptr, &destRect); } -- cgit 1.4.1