Skip to content

Commit

Permalink
Merge pull request CleverRaven#78103 from alef/title_splash_fix
Browse files Browse the repository at this point in the history
Fix crashing in CURSES without ASCII title art
  • Loading branch information
kevingranade authored Nov 24, 2024
2 parents 63fdbe7 + af3c10e commit 5b0c138
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/loading_ui.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "loading_ui.h"

#include "cached_options.h"
#include "options.h"
#include "input.h"
#include "output.h"
#include "ui_manager.h"
Expand Down Expand Up @@ -125,8 +126,10 @@ static void update_state( const std::string &context, const std::string &step )
gLUI->splash = CreateTextureFromSurface( get_sdl_renderer(), surf );
gLUI->window_size = gLUI->splash_size + ImVec2{ 0.0f, 2.0f * ImGui::GetTextLineHeightWithSpacing() };
#else
std::string splash = read_whole_file( PATH_INFO::title( get_holiday_from_time() ) ).value_or(
_( "Cataclysm: Dark Days Ahead" ) );
std::string splash = PATH_INFO::title( get_holiday_from_time() );
if( get_option<bool>( "ENABLE_ASCII_TITLE" ) ) {
splash = read_whole_file( splash ).value_or( _( "Cataclysm: Dark Days Ahead" ) );
}
gLUI->splash = string_split( splash, '\n' );
gLUI->blanks = std::string( TERMX, ' ' );
for( const std::string &line : gLUI->splash ) {
Expand Down

0 comments on commit 5b0c138

Please sign in to comment.