Author: mordante
Date: Wed Apr 29 20:47:10 2009
New Revision: 35328
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35328&view=rev
Log:
Better validate the map area size.
This fixes the result of bug #13420 (the cause still needs to be fixed).
Modified:
trunk/src/gui/widgets/window.cpp
Modified: trunk/src/gui/widgets/window.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window.cpp?rev=35328&r1=35327&r2=35328&view=diff
==============================================================================
--- trunk/src/gui/widgets/window.cpp (original)
+++ trunk/src/gui/widgets/window.cpp Wed Apr 29 20:47:10 2009
@@ -150,17 +150,20 @@
settings::screen_width = rect.w;
settings::screen_height = rect.h;
+ settings::gamemap_width = settings::screen_width;
+ settings::gamemap_height = settings::screen_height;
+
game_display* display = game_display::get_singleton();
if(display) {
- settings::gamemap_width = display->map_outside_area().w;
- settings::gamemap_height =
display->map_outside_area().h;
- } else {
- settings::gamemap_width = settings::screen_width;
- settings::gamemap_height = settings::screen_height;
- }
- }
-}
-
+ const unsigned w = display->map_outside_area().w;
+ const unsigned h = display->map_outside_area().h;
+ if(w && h) {
+ settings::gamemap_width = w;
+ settings::gamemap_height = h;
+ }
+ }
+ }
+}
twindow::tretval twindow::get_retval_by_id(const std::string& id)
{
/*WIKI
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits