hedgewars/uCaptions.pas
changeset 6394 f0a9042e7387
parent 6383 c34a8b98d78c
child 6415 af2047bb4f70
--- a/hedgewars/uCaptions.pas	Thu Nov 17 23:14:24 2011 +0300
+++ b/hedgewars/uCaptions.pas	Fri Nov 18 00:32:52 2011 +0100
@@ -25,7 +25,7 @@
 
 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
 procedure DrawCaptions;
-procedure ReloadCaptions;
+procedure ReloadCaptions(unload: boolean);
 
 procedure initModule;
 procedure freeModule;
@@ -65,15 +65,13 @@
 end;
 
 // For uStore texture recreation
-procedure ReloadCaptions;
+procedure ReloadCaptions(unload: boolean);
 var Group: TCapGroup;
 begin
 for Group:= Low(TCapGroup) to High(TCapGroup) do
-    begin
-    FreeTexture(Captions[Group].Tex);
-    if Captions[Group].Text <> '' then
+    if unload then FreeTexture(Captions[Group].Tex)
+    else if Captions[Group].Text <> '' then
         Captions[Group].Tex:= RenderStringTex(Captions[Group].Text, Captions[Group].Color, fntBig)
-    end
 end;
 
 procedure DrawCaptions;