Avoid returning an array for the sake of pas2c
authornemo
Fri, 11 May 2012 11:08:50 -0400
changeset 7051 db17476d7a37
parent 7050 91199321e916
child 7052 cefb73639f70
Avoid returning an array for the sake of pas2c
hedgewars/hwengine.pas
hedgewars/uLand.pas
--- a/hedgewars/hwengine.pas	Fri May 11 00:11:01 2012 +0200
+++ b/hedgewars/hwengine.pas	Fri May 11 11:08:50 2012 -0400
@@ -481,7 +481,7 @@
     IPCWaitPongEvent;
     TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true);
 
-    Preview:= GenPreview();
+    GenPreview(Preview);
     WriteLnToConsole('Sending preview...');
     SendIPCRaw(@Preview, sizeof(Preview));
     SendIPCRaw(@MaxHedgehogs, sizeof(byte));
--- a/hedgewars/uLand.pas	Fri May 11 00:11:01 2012 +0200
+++ b/hedgewars/uLand.pas	Fri May 11 11:08:50 2012 -0400
@@ -26,7 +26,7 @@
 procedure freeModule;
 procedure DrawBottomBorder;
 procedure GenMap;
-function  GenPreview: TPreview;
+procedure GenPreview(var Preview: TPreview);
 
 implementation
 uses uConsole, uStore, uRandom, uLandObjects, uIO, uLandTexture, sysutils,
@@ -677,9 +677,8 @@
 UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT);
 end;
 
-function GenPreview: TPreview;
+procedure GenPreview(var Preview: TPreview);
 var x, y, xx, yy, t, bit, cbit, lh, lw: LongInt;
-    Preview: TPreview;
 begin
     WriteLnToConsole('Generating preview...');
     case cMapGen of
@@ -708,8 +707,6 @@
                     Preview[y, x]:= Preview[y, x] or ($80 shr bit);
             end;
         end;
-
-    GenPreview:= Preview
 end;