diff options
Diffstat (limited to 'src/renderer.cpp')
-rw-r--r-- | src/renderer.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/renderer.cpp b/src/renderer.cpp index 2fc6023..afc022e 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp | |||
@@ -121,6 +121,8 @@ void Renderer::loadAllTextures() { | |||
121 | loadTextureFromFile("read_instruction.png", readInstruction_); | 121 | loadTextureFromFile("read_instruction.png", readInstruction_); |
122 | loadTextureFromFile("menu.png", menuBg_); | 122 | loadTextureFromFile("menu.png", menuBg_); |
123 | loadTextureFromFile("help.png", help_); | 123 | loadTextureFromFile("help.png", help_); |
124 | loadTextureFromFile("message.png", messageBg_); | ||
125 | loadTextureFromFile("feather.png", feather_); | ||
124 | 126 | ||
125 | loadTextureFromFile("title0.png", titles_[0]); | 127 | loadTextureFromFile("title0.png", titles_[0]); |
126 | SDL_QueryTexture(titles_[0].get(), nullptr, nullptr, &titleWidths_[0], &titleHeights_[0]); | 128 | SDL_QueryTexture(titles_[0].get(), nullptr, nullptr, &titleWidths_[0], &titleHeights_[0]); |
@@ -455,16 +457,8 @@ void Renderer::renderGame( | |||
455 | opacity = game.sign.signDisplayFade.getProgress(255, 0); | 457 | opacity = game.sign.signDisplayFade.getProgress(255, 0); |
456 | } | 458 | } |
457 | 459 | ||
458 | SDL_Rect signRect { | 460 | SDL_SetTextureAlphaMod(messageBg_.get(), opacity); |
459 | 0, | 461 | SDL_RenderCopy(ren_.get(), messageBg_.get(), nullptr, nullptr); |
460 | GAME_HEIGHT / 2 - (45 * 2 + 1 + MESSAGE_MARGIN * 2) / 2, | ||
461 | GAME_WIDTH, | ||
462 | 45 * 2 + 1 + MESSAGE_MARGIN * 2 | ||
463 | }; | ||
464 | |||
465 | SDL_SetRenderDrawBlendMode(ren_.get(), SDL_BLENDMODE_BLEND); | ||
466 | SDL_SetRenderDrawColor(ren_.get(), 0, 0, 0, opacity); | ||
467 | SDL_RenderFillRect(ren_.get(), &signRect); | ||
468 | 462 | ||
469 | if (game.sign.signDisplayState == SignInstructionState::Visible) { | 463 | if (game.sign.signDisplayState == SignInstructionState::Visible) { |
470 | int lineIndex = 0; | 464 | int lineIndex = 0; |
@@ -493,6 +487,17 @@ void Renderer::renderGame( | |||
493 | 487 | ||
494 | lineIndex++; | 488 | lineIndex++; |
495 | } | 489 | } |
490 | |||
491 | if (game.sign.showNextArrow) { | ||
492 | SDL_Rect destRect { | ||
493 | GAME_WIDTH - MESSAGE_MARGIN - 32, | ||
494 | GAME_HEIGHT / 2 + (45 + 1 + MESSAGE_MARGIN) / 2 + game.sign.nextArrowBobPos - 32, | ||
495 | 64, | ||
496 | 64 }; | ||
497 | |||
498 | SDL_SetRenderTarget(ren_.get(), overlays.get()); | ||
499 | SDL_RenderCopy(ren_.get(), feather_.get(), nullptr, &destRect); | ||
500 | } | ||
496 | } | 501 | } |
497 | } | 502 | } |
498 | 503 | ||