mirror of
https://github.com/dpethes/rerogue.git
synced 2025-06-07 18:58:32 +02:00
terrain viewer: plug some more memleaks
This commit is contained in:
parent
5c623d9bbf
commit
d42f895773
@ -175,10 +175,10 @@ begin
|
|||||||
//init uv coords. block_texcoords is quite pessimistic
|
//init uv coords. block_texcoords is quite pessimistic
|
||||||
SetLength(block_texcoords, VerticesPerBlock * terrain.TileHeight * terrain.TileWidth);
|
SetLength(block_texcoords, VerticesPerBlock * terrain.TileHeight * terrain.TileWidth);
|
||||||
for blk := 0 to Length(block_texcoords) div VerticesPerBlock - 1 do
|
for blk := 0 to Length(block_texcoords) div VerticesPerBlock - 1 do
|
||||||
for y := 0 to 4 do
|
for y := 0 to 4 do
|
||||||
for x := 0 to 4 do begin
|
for x := 0 to 4 do begin
|
||||||
block_texcoords[blk*25 + y * 5 + x].init(x/4, 1 - y/4); //u, v
|
block_texcoords[blk*VerticesPerBlock + y * 5 + x].init(x/4, 1 - y/4); //u, v
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TTerrainMesh.Destroy;
|
destructor TTerrainMesh.Destroy;
|
||||||
@ -191,7 +191,9 @@ begin
|
|||||||
freemem(render_batches[i].normals);
|
freemem(render_batches[i].normals);
|
||||||
freemem(render_batches[i].face_indices);
|
freemem(render_batches[i].face_indices);
|
||||||
end;
|
end;
|
||||||
|
block_texcoords := nil;
|
||||||
render_batches := nil;
|
render_batches := nil;
|
||||||
|
blocks := nil;
|
||||||
terrain.Free;
|
terrain.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -130,6 +130,7 @@
|
|||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
<Linking>
|
<Linking>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
<TrashVariables Value="True"/>
|
<TrashVariables Value="True"/>
|
||||||
</Debugging>
|
</Debugging>
|
||||||
</Linking>
|
</Linking>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user