Skip to content

Commit

Permalink
Merge pull request #27840 from ZhilkinSerg/android-graphics-options
Browse files Browse the repository at this point in the history
Fix crashes in Android builds
  • Loading branch information
kevingranade authored Jan 25, 2019
2 parents 0525397 + 05e443d commit 28c87d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/debug_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,11 @@ void draw_benchmark( const int max_difference )
"\n| USE_TILES | RENDERER | FRAMEBUFFER_ACCEL | USE_COLOR_MODULATED_TEXTURES | FPS |" <<
"\n|:---:|:---:|:---:|:---:|:---:|\n| " <<
get_option<bool>( "USE_TILES" ) << " | " <<
#ifndef __ANDROID__
get_option<std::string>( "RENDERER" ) << " | " <<
#else
get_option<bool>( "SOFTWARE_RENDERING" ) << " | " <<
#endif
get_option<bool>( "FRAMEBUFFER_ACCEL" ) << " | " <<
get_option<bool>( "USE_COLOR_MODULATED_TEXTURES" ) << " | " <<
int( 1000.0 * draw_counter / ( double )difference ) << " |\n";
Expand Down
4 changes: 4 additions & 0 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ void WinCreate()
format.reset( SDL_AllocFormat( wformat ) );
throwErrorIf( !format, "SDL_AllocFormat failed" );

#ifndef __ANDROID__
bool software_renderer = get_option<std::string>( "RENDERER" ).empty();
int renderer_id = -1;
std::string renderer_name;
Expand All @@ -418,6 +419,9 @@ void WinCreate()
break;
}
}
#else
bool software_renderer = get_option<bool>( "SOFTWARE_RENDERING" );
#endif

if( !software_renderer ) {
dbg( D_INFO ) << "Attempting to initialize accelerated SDL renderer.";
Expand Down

0 comments on commit 28c87d1

Please sign in to comment.