summary refs log tree commit diff stats
path: root/src/renderer.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-12 00:14:38 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-12 00:14:38 -0500
commit19be2ac58b09c5240a32e6a4f41cd9f6cda03d07 (patch)
tree2899673572cdb25645f425c733c57bb9c719d5b7 /src/renderer.cpp
parent81d1afa871c947ec6ba44e11cd6041fe16ed5756 (diff)
downloadtanetane-19be2ac58b09c5240a32e6a4f41cd9f6cda03d07.tar.gz
tanetane-19be2ac58b09c5240a32e6a4f41cd9f6cda03d07.tar.bz2
tanetane-19be2ac58b09c5240a32e6a4f41cd9f6cda03d07.zip
Added message bullets
Diffstat (limited to 'src/renderer.cpp')
-rw-r--r--src/renderer.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/renderer.cpp b/src/renderer.cpp index 0c70ef5..0e77bb9 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp
@@ -201,17 +201,28 @@ void Renderer::render(Game& game) {
201 201
202 // 18x, 127y1, 143y2 202 // 18x, 127y1, 143y2
203 if (line.charsRevealed > 0) { 203 if (line.charsRevealed > 0) {
204 SDL_Rect srcRect { 204 {
205 0, 0, messageLines_[lineIndex].charIndexToWidth[line.charsRevealed], 205 SDL_Rect srcRect {
206 game.getFont().getCharacterHeight() 206 0, 0, messageLines_[lineIndex].charIndexToWidth[line.charsRevealed],
207 }; 207 game.getFont().getCharacterHeight()
208 SDL_Rect destRect { 208 };
209 18, 209 SDL_Rect destRect {
210 127 + 16 * lineIndex, 210 18,
211 srcRect.w, 211 127 + 16 * lineIndex,
212 srcRect.h }; 212 srcRect.w,
213 213 srcRect.h };
214 SDL_RenderCopy(ren_.get(), messageLines_[lineIndex].renderedTex.get(), &srcRect, &destRect); 214
215 SDL_RenderCopy(ren_.get(), messageLines_[lineIndex].renderedTex.get(), &srcRect, &destRect);
216 }
217
218 if (line.bulleted) {
219 vec2i charLoc = game.getFont().getCharacterLocation('^');
220 vec2i charSize = game.getFont().getCharacterSize('^');
221 SDL_Rect srcRect { charLoc.x(), charLoc.y(), charSize.w(), charSize.h() };
222 SDL_Rect destRect { 13, 127 + 16 * lineIndex, charSize.w(), charSize.h() };
223
224 SDL_RenderCopy(ren_.get(), textures_.at(game.getFont().getTextureId()).get(), &srcRect, &destRect);
225 }
215 } 226 }
216 227
217 lineIndex++; 228 lineIndex++;