widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #01044
[Merge] lp:~qcumber-some/widelands/bug704637_2 into lp:widelands
Jens Beyer (Qcumber-some) has proposed merging lp:~qcumber-some/widelands/bug704637_2 into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~qcumber-some/widelands/bug704637_2/+merge/151828
Additional commit regarding bug704637 - show message in case this happens.
I hope I've done everything correct. Just nitpick in case I could do something in a better way :-)
--
https://code.launchpad.net/~qcumber-some/widelands/bug704637_2/+merge/151828
Your team Widelands Developers is requested to review the proposed merge of lp:~qcumber-some/widelands/bug704637_2 into lp:widelands.
=== modified file 'src/graphic/graphic.cc'
--- src/graphic/graphic.cc 2013-03-04 10:43:03 +0000
+++ src/graphic/graphic.cc 2013-03-05 20:03:23 +0000
@@ -77,6 +77,10 @@
{
ImageTransformations::initialize();
+ //preset flag, if at the end this is true, a message is displayed
+ //in wlapplication.cc
+ fallback_settings_in_effect = false;
+
//fastOpen tries to use mmap
FileRead fr;
#ifndef WIN32
@@ -133,6 +137,7 @@
flags &= ~SDL_FULLSCREEN;
sdlsurface = SDL_SetVideoMode
(FALLBACK_GRAPHICS_WIDTH, FALLBACK_GRAPHICS_HEIGHT, FALLBACK_GRAPHICS_DEPTH, flags);
+ fallback_settings_in_effect = true;
if (!sdlsurface)
throw wexception
("Graphics: could not set video mode: %s", SDL_GetError());
@@ -303,6 +308,11 @@
m_rendertarget = new RenderTarget(screen_.get());
}
+bool Graphic::check_fallback_settings_in_effect()
+{
+ return fallback_settings_in_effect;
+}
+
/**
* Free the surface
*/
=== modified file 'src/graphic/graphic.h'
--- src/graphic/graphic.h 2013-03-01 18:43:44 +0000
+++ src/graphic/graphic.h 2013-03-05 20:03:23 +0000
@@ -130,8 +130,11 @@
const GraphicCaps& caps() const throw () {return m_caps;}
+ bool check_fallback_settings_in_effect();
+
private:
void save_png_(Surface & surf, StreamWrite*) const;
+ bool fallback_settings_in_effect;
protected:
// Static helper function for png writing
=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc 2013-02-16 01:05:43 +0000
+++ src/wlapplication.cc 2013-03-05 20:03:23 +0000
@@ -1534,6 +1534,13 @@
std::string messagetitle;
std::string message;
+ if (g_gr->check_fallback_settings_in_effect())
+ {
+ message = _
+ ("Your video settings could not be enabled, and fallback settings are in effect. "
+ "Please check the graphics options!");
+ }
+
for (;;) {
// Refresh graphics system in case we just changed resolution.
refresh_graphics();