2
0
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:
dpethes 2020-06-15 14:13:51 +02:00
parent 5c623d9bbf
commit d42f895773
2 changed files with 7 additions and 4 deletions

View File

@ -175,10 +175,10 @@ begin
//init uv coords. block_texcoords is quite pessimistic
SetLength(block_texcoords, VerticesPerBlock * terrain.TileHeight * terrain.TileWidth);
for blk := 0 to Length(block_texcoords) div VerticesPerBlock - 1 do
for y := 0 to 4 do
for x := 0 to 4 do begin
block_texcoords[blk*25 + y * 5 + x].init(x/4, 1 - y/4); //u, v
end;
for y := 0 to 4 do
for x := 0 to 4 do begin
block_texcoords[blk*VerticesPerBlock + y * 5 + x].init(x/4, 1 - y/4); //u, v
end;
end;
destructor TTerrainMesh.Destroy;
@ -191,7 +191,9 @@ begin
freemem(render_batches[i].normals);
freemem(render_batches[i].face_indices);
end;
block_texcoords := nil;
render_batches := nil;
blocks := nil;
terrain.Free;
end;

View File

@ -130,6 +130,7 @@
</CodeGeneration>
<Linking>
<Debugging>
<UseHeaptrc Value="True"/>
<TrashVariables Value="True"/>
</Debugging>
</Linking>