Thanks a lot for such a great research.
But still, the only thing I'm interested is speed, even when it costs me additional 4 bytes for the pointer. But now when the reading goes in a loop, I'm not sure it's so fast anymore.
I need to test it.
What I discovered is:
The problem occurs only when the map isn't saved to a file before loading. The constructor reads as follow:
(fills the header, and sets the length of the array, then:)
for x := 0 to Header.width - 1 do
for y := 0 to Header.height - 1 do begin
terrain[x,y].Index...
Hi there.
I have this dynamic 2d array of records:
TTerrainCell = record
Index : integer;
end;
Terrain : array of array of TTCell;
And a loading procedure:
var
f : file of byte;
begin
assignfile(f,filename);
reset(f);
blockread(f,Header,sizeof(TMapHeader))...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.