- Remove one AddProgress call
authorunc0rr
Tue, 28 Jul 2009 16:29:39 +0000
changeset 2284 bd091b6b128d
parent 2283 2bcb75cead52
child 2285 6746bda385e8
- Remove one AddProgress call - Forbid calling AddProgress after initialization
hedgewars/uKeys.pas
hedgewars/uStore.pas
--- a/hedgewars/uKeys.pas	Tue Jul 28 12:50:47 2009 +0000
+++ b/hedgewars/uKeys.pas	Tue Jul 28 16:29:39 2009 +0000
@@ -110,9 +110,7 @@
 TryDo(i < cKeyMaxIndex, 'SDL keys number is more than expected (' + inttostr(i) + ')', true);
 
 for t:= 0 to Pred(i) do
-    tkbd[i]:= pkbd^[i];
-	
-	AddProgress;
+    tkbd[i]:= pkbd^[i]
 end;
 
 procedure InitKbdKeyTable;
--- a/hedgewars/uStore.pas	Tue Jul 28 12:50:47 2009 +0000
+++ b/hedgewars/uStore.pas	Tue Jul 28 16:29:39 2009 +0000
@@ -990,6 +990,7 @@
     Step: integer = 0;
 	squaresize : LongInt;
 	numsquares : integer;
+
 procedure AddProgress;
 var r: TSDL_Rect;
     texsurf: PSDL_Surface;
@@ -1004,6 +1005,8 @@
    numsquares:= ProgrTex^.h div squaresize;
    end;
 
+TryDo(ProgrTex <> nil, 'ProgrTex = nil!', true);
+
 glClear(GL_COLOR_BUFFER_BIT);
 glEnable(GL_TEXTURE_2D);
 if Step < numsquares then r.x:= 0
@@ -1021,7 +1024,8 @@
 procedure FinishProgress;
 begin
 WriteLnToConsole('Freeing progress surface... ');
-FreeTexture(ProgrTex)
+FreeTexture(ProgrTex);
+ProgrTex:= nil
 end;
 
 procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean);