# HG changeset patch # User unc0rr # Date 1314786192 -14400 # Node ID efd8b227cc71237613c61db041710d28c305eec2 # Parent 08944be1d679c7fa1218b4aba9a998a4554438af - Don't reload fonts - Fix one more ifdef which made me waste an hour debugging crash diff -r 08944be1d679 -r efd8b227cc71 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Wed Aug 31 13:47:48 2011 +0400 +++ b/hedgewars/uStore.pas Wed Aug 31 14:23:12 2011 +0400 @@ -260,17 +260,19 @@ i: LongInt; begin AddFileLog('StoreLoad()'); -for fi:= Low(THWFont) to High(THWFont) do - with Fontz[fi] do - begin - s:= UserPathz[ptFonts] + '/' + Name; - if not FileExists(s) then s:= Pathz[ptFonts] + '/' + Name; - WriteToConsole(msgLoading + s + ' (' + inttostr(Height) + 'pt)... '); - Handle:= TTF_OpenFont(Str2PChar(s), Height); - SDLTry(Handle <> nil, true); - TTF_SetFontStyle(Handle, style); - WriteLnToConsole(msgOK) - end; + +if not reload then + for fi:= Low(THWFont) to High(THWFont) do + with Fontz[fi] do + begin + s:= UserPathz[ptFonts] + '/' + Name; + if not FileExists(s) then s:= Pathz[ptFonts] + '/' + Name; + WriteToConsole(msgLoading + s + ' (' + inttostr(Height) + 'pt)... '); + Handle:= TTF_OpenFont(Str2PChar(s), Height); + SDLTry(Handle <> nil, true); + TTF_SetFontStyle(Handle, style); + WriteLnToConsole(msgOK) + end; WriteNames(fnt16); MakeCrossHairs; @@ -345,10 +347,10 @@ // This should maybe be flagged. It wastes quite a bit of memory. if not reload then begin -{$IFNDEF DARWIN & WIN32} +{$IF DEFINED(DARWIN) OR DEFINED(WIN32)} + Surface:= tmpsurf +{$ELSE} if saveSurf then Surface:= tmpsurf else SDL_FreeSurface(tmpsurf) -{$ELSE} - Surface:= tmpsurf {$ENDIF} end end @@ -756,7 +758,6 @@ SDL_GL_SwapBuffers(); {$ENDIF} inc(Step); - end; procedure FinishProgress; @@ -764,6 +765,7 @@ WriteLnToConsole('Freeing progress surface... '); FreeTexture(ProgrTex); uMobile.GameLoaded(); + Step:= 0 end; function RenderHelpWindow(caption, subcaption, description, extra: ansistring; extracolor: LongInt; iconsurf: PSDL_Surface; iconrect: PSDL_Rect): PTexture; @@ -1037,7 +1039,9 @@ StoreRelease(true); StoreLoad(true); + ResetLand; + UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT) end; end;