diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-20 20:14:46 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-20 20:14:46 -0400 |
commit | e5fc5bccff29bce3de09209707cf8dbe14a80b35 (patch) | |
tree | 4243d2aa029cfc7d172072cdd0170c5e7ad2f3de /src/renderer.cpp | |
parent | e70f905372f30887778d72f5a321be76731b7b82 (diff) | |
download | ether-e5fc5bccff29bce3de09209707cf8dbe14a80b35.tar.gz ether-e5fc5bccff29bce3de09209707cf8dbe14a80b35.tar.bz2 ether-e5fc5bccff29bce3de09209707cf8dbe14a80b35.zip |
control instructions
Diffstat (limited to 'src/renderer.cpp')
-rw-r--r-- | src/renderer.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/renderer.cpp b/src/renderer.cpp index 5d6ac08..2fc6023 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp | |||
@@ -120,6 +120,7 @@ void Renderer::loadAllTextures() { | |||
120 | loadTextureFromFile("lamp.png", lamp_); | 120 | loadTextureFromFile("lamp.png", lamp_); |
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 | 124 | ||
124 | loadTextureFromFile("title0.png", titles_[0]); | 125 | loadTextureFromFile("title0.png", titles_[0]); |
125 | SDL_QueryTexture(titles_[0].get(), nullptr, nullptr, &titleWidths_[0], &titleHeights_[0]); | 126 | SDL_QueryTexture(titles_[0].get(), nullptr, nullptr, &titleWidths_[0], &titleHeights_[0]); |
@@ -424,7 +425,17 @@ void Renderer::renderGame( | |||
424 | SDL_SetRenderDrawColor(ren_.get(), 0, 0, 0, 0); | 425 | SDL_SetRenderDrawColor(ren_.get(), 0, 0, 0, 0); |
425 | SDL_RenderClear(ren_.get()); | 426 | SDL_RenderClear(ren_.get()); |
426 | 427 | ||
427 | if (game.signInstructionState != SignInstructionState::Hidden) { | 428 | if (game.helpState == HelpState::FadeIn || game.helpState == HelpState::Hold || game.helpState == HelpState::FadeOut) { |
429 | int instOpacity = 255; | ||
430 | if (game.helpState == HelpState::FadeIn) { | ||
431 | instOpacity = game.helpProgress.getProgress(0, 255); | ||
432 | } else if (game.helpState == HelpState::FadeOut) { | ||
433 | instOpacity = game.helpProgress.getProgress(255, 0); | ||
434 | } | ||
435 | |||
436 | SDL_SetTextureAlphaMod(help_.get(), instOpacity); | ||
437 | SDL_RenderCopy(ren_.get(), help_.get(), nullptr, nullptr); | ||
438 | } else if (game.signInstructionState != SignInstructionState::Hidden) { | ||
428 | int instOpacity = 255; | 439 | int instOpacity = 255; |
429 | if (game.signInstructionState == SignInstructionState::FadingIn) { | 440 | if (game.signInstructionState == SignInstructionState::FadingIn) { |
430 | instOpacity = game.signFade.getProgress(0, 255); | 441 | instOpacity = game.signFade.getProgress(0, 255); |