From 9fe4b959ac90c91185ea0974f9a4d16091b0d3aa Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 24 Aug 2011 12:11:10 +0000 Subject: (svn r22818) -Fix [FS#4742] (r22796, rlongago): don't spawn threads for world generation and NewGRF scanning when using the dedicated or null video driver regardless of the used blitter --- src/video/dedicated_v.h | 1 + src/video/null_v.h | 1 + src/video/video_driver.hpp | 13 +++++++++++++ 3 files changed, 15 insertions(+) (limited to 'src/video') diff --git a/src/video/dedicated_v.h b/src/video/dedicated_v.h index c06f050cd..7d449d159 100644 --- a/src/video/dedicated_v.h +++ b/src/video/dedicated_v.h @@ -29,6 +29,7 @@ public: /* virtual */ bool ToggleFullscreen(bool fullscreen); /* virtual */ const char *GetName() const { return "dedicated"; } + /* virtual */ bool HasGUI() const { return false; } }; /** Factory for the dedicated server video driver. */ diff --git a/src/video/null_v.h b/src/video/null_v.h index fa0ff054f..9bc26c4ef 100644 --- a/src/video/null_v.h +++ b/src/video/null_v.h @@ -32,6 +32,7 @@ public: /* virtual */ bool ToggleFullscreen(bool fullscreen); /* virtual */ const char *GetName() const { return "null"; } + /* virtual */ bool HasGUI() const { return false; } }; /** Factory the null video driver. */ diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index 1e647cb1c..76f624cdb 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -46,6 +46,19 @@ public: * @return True if the change succeeded. */ virtual bool ToggleFullscreen(bool fullscreen) = 0; + + /** + * Whether the driver has a graphical user interface with the end user. + * Or in other words, whether we should spawn a thread for world generation + * and NewGRF scanning so the graphical updates can keep coming. Otherwise + * progress has to be shown on the console, which uses by definition another + * thread/process for display purposes. + * @return True for all drivers except null and dedicated. + */ + virtual bool HasGUI() const + { + return true; + } }; /** Base of the factory for the video drivers. */ -- cgit v1.2.3-70-g09d2