bi: Fix --report SIGSEGV caused by uninitialised video
At some point in 1.17.x, the check for whether the game window was null disappeared. This brings it back by exposing a check through the video namespace so as to avoid piggybacking further on the video::get_window() function, which we are meant to avoid using.
This commit is contained in:
parent
edbf332d48
commit
1a430b7ecc
3 changed files with 12 additions and 0 deletions
|
@ -550,6 +550,10 @@ list_formatter video_settings_report_internal(const std::string& heading = "")
|
|||
placeholder = "Running in non-interactive mode.";
|
||||
}
|
||||
|
||||
if(!video::has_window()) {
|
||||
placeholder = "Video not initialized yet.";
|
||||
}
|
||||
|
||||
if(!placeholder.empty()) {
|
||||
fmt.set_placeholder(placeholder);
|
||||
return fmt;
|
||||
|
|
|
@ -397,6 +397,11 @@ void init_window()
|
|||
update_framebuffer();
|
||||
}
|
||||
|
||||
bool has_window()
|
||||
{
|
||||
return bool(window);
|
||||
}
|
||||
|
||||
point output_size()
|
||||
{
|
||||
if (testing_) {
|
||||
|
|
|
@ -85,6 +85,9 @@ bool testing();
|
|||
/* Windowing functions */
|
||||
/***********************/
|
||||
|
||||
/** Whether the game has set up a window to render into */
|
||||
bool has_window();
|
||||
|
||||
/** Whether we are currently in fullscreen mode */
|
||||
bool is_fullscreen();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue