diff options
Diffstat (limited to 'src/renderer.cpp')
-rw-r--r-- | src/renderer.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/renderer.cpp b/src/renderer.cpp index 09bddc9..5d6ac08 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp | |||
@@ -33,6 +33,15 @@ Renderer::Renderer() | |||
33 | throw sdl_error(); | 33 | throw sdl_error(); |
34 | } | 34 | } |
35 | 35 | ||
36 | loadAllTextures(); | ||
37 | |||
38 | font_ = font_ptr(TTF_OpenFont(Runtime::getResourcePath("softsquare.ttf").c_str(), 45)); | ||
39 | if (!font_) { | ||
40 | throw ttf_error(); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | void Renderer::loadAllTextures() { | ||
36 | texture_ptr origFade; | 45 | texture_ptr origFade; |
37 | loadTextureFromFile("lighting.png", origFade); | 46 | loadTextureFromFile("lighting.png", origFade); |
38 | 47 | ||
@@ -120,11 +129,6 @@ Renderer::Renderer() | |||
120 | 129 | ||
121 | loadTextureFromFile("title3.png", titles_[2]); | 130 | loadTextureFromFile("title3.png", titles_[2]); |
122 | SDL_QueryTexture(titles_[2].get(), nullptr, nullptr, &titleWidths_[2], &titleHeights_[2]); | 131 | SDL_QueryTexture(titles_[2].get(), nullptr, nullptr, &titleWidths_[2], &titleHeights_[2]); |
123 | |||
124 | font_ = font_ptr(TTF_OpenFont(Runtime::getResourcePath("softsquare.ttf").c_str(), 45)); | ||
125 | if (!font_) { | ||
126 | throw ttf_error(); | ||
127 | } | ||
128 | } | 132 | } |
129 | 133 | ||
130 | void Renderer::renderGame( | 134 | void Renderer::renderGame( |
@@ -689,4 +693,9 @@ void Renderer::toggleFullscreen() { | |||
689 | } else { | 693 | } else { |
690 | SDL_SetWindowFullscreen(win_.get(), 0); | 694 | SDL_SetWindowFullscreen(win_.get(), 0); |
691 | } | 695 | } |
696 | |||
697 | #ifdef MSVC | ||
698 | loadAllTextures(); | ||
699 | menu_.reset(); | ||
700 | #endif | ||
692 | } | 701 | } |