Author: mordante
Date: Wed Apr 29 21:08:35 2009
New Revision: 35329
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35329&view=rev
Log:
Better validate the map area size.
Modified:
branches/1.6/src/gui/widgets/window.cpp
Modified: branches/1.6/src/gui/widgets/window.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/gui/widgets/window.cpp?rev=35329&r1=35328&r2=35329&view=diff
==============================================================================
--- branches/1.6/src/gui/widgets/window.cpp (original)
+++ branches/1.6/src/gui/widgets/window.cpp Wed Apr 29 21:08:35 2009
@@ -147,17 +147,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