# HG changeset patch # User sheepluva # Date 1316071196 -7200 # Node ID 4a28d0ae9624f400d2be495d6e5e43053a4e1ac6 # Parent c9a4de51b5a0751e1f09cf1fc5b4d543f9993d8d based on the fact that the crash never seemed to have happened with default screen resolutions and also inspired by the only other getmem usage in the code I came up with this simple solution which seems to work just fine. I do not understand why getmem seems to need this, but well - feel free to explain. diff -r c9a4de51b5a0 -r 4a28d0ae9624 hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Thu Sep 15 03:17:23 2011 +0200 +++ b/hedgewars/uMisc.pas Thu Sep 15 09:19:56 2011 +0200 @@ -32,7 +32,7 @@ procedure freeModule; implementation -uses typinfo, sysutils, uVariables; +uses typinfo, sysutils, uVariables, uUtils; procedure movecursor(dx, dy: LongInt); var x, y: LongInt; @@ -74,7 +74,7 @@ ScreenFadeValue:= sfMax; ScreenFadeSpeed:= 5; -size:= cScreenWidth * cScreenHeight * 3; +size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 3; p:= GetMem(size); // memory could not be allocated