From 51ca58c1b5e8184bc4735d593749204ff04919dc Mon Sep 17 00:00:00 2001
From: n0body <>
Date: Sat, 12 Jul 2003 14:03:14 +0000
Subject: [PATCH] Applied patch for saveames in different resolutions. Fixed
 campaign pictures.

---
 doc/ChangeLog.html |  2 ++
 src/ui/ui.cpp      | 12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/ChangeLog.html b/doc/ChangeLog.html
index 4927130d7..95eaeb3cb 100644
--- a/doc/ChangeLog.html
+++ b/doc/ChangeLog.html
@@ -36,6 +36,8 @@
 <li>Future 1.19 Release<p>
     <ul>
     <li>+++
+    <li>Fixed loading games saved with different resolutions (from Martin Renold).
+    <li>Removed spaces from data files (from Martin Renold).
     <li>Changed the handling of contained units to a circular linked list (from Crestez Dan Leonard).
     <li>Compacted Unit::Rescued and Unit::Rescued from (from Crestez Dan Leonard).
     <li>Change Unit::Colors to a pointer(saves memory) (from Crestez Dan Leonard).
diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp
index 1d567ced7..f26171f82 100644
--- a/src/ui/ui.cpp
+++ b/src/ui/ui.cpp
@@ -501,6 +501,8 @@ local void SaveViewports(FILE* file,const UI* ui)
 */
 global void SaveUserInterface(FILE* file)
 {
+    int i;
+
     fprintf(file,"\n;;; -----------------------------------------\n");
     fprintf(file,";;; MODULE: ui $Id$\n\n");
 
@@ -522,8 +524,14 @@ global void SaveUserInterface(FILE* file)
     fprintf(file,"(set-original-resources! %s)\n\n",
 	    TheUI.OriginalResources ? "#t" : "#f");
 
-    // Save the current UI
-    SaveUi(file,&TheUI);
+    // Save the UIs for all resolutions
+    for( i=0; UI_Table[i]; ++i ) {
+	SaveUi(file,UI_Table[i]);
+    }
+
+    // FIXME: maxy: strange things could happen to the saved viewports
+    // when loading them on a different resolution
+
     SaveViewports(file,&TheUI);
 }