here is the code Lee sent me some way back now, for your reference:
void terrain_load ( void )
{
if ( FileExist(t.tfile_s.Get()) == 1 && t.terrain.TerrainID > 0 )
{
OpenToRead ( 1, t.tfile_s.Get() );
if ( MemblockExist(1) == 0 )
{
ReadMemblock ( 1, 1 );
t.mi = 0;
for ( t.z = 0; t.z <= 1023; t.z++ )
{
for ( t.x = 0 ; t.x <= 1023; t.x++ )
{
t.h_f = ReadMemblockFloat(1,t.mi);
t.terrainmatrix[t.x][t.z] = t.h_f;
t.mi += 4;
BT_SetPointHeight ( t.terrain.TerrainID, t.x, t.z, t.h_f );
}
}
DeleteMemblock ( 1 );
// force a shore on all terrain imported
t.x = 0; for ( t.z = 0 ; t.z <= 1023 ; t.z++ ) BT_SetPointHeight ( t.terrain.TerrainID, t.x, t.z, 0.0 );
t.x = 1023; for ( t.z = 0 ; t.z<= 1023 ; t.z++ ) BT_SetPointHeight ( t.terrain.TerrainID, t.x, t.z, 0.0 );
t.z = 0 ; for ( t.x = 0 ; t.x <= 1023 ; t.x++ ) BT_SetPointHeight ( t.terrain.TerrainID, t.x, t.z, 0.0 );
t.z = 1023; for ( t.x = 0 ; t.x <= 1023 ; t.x++ ) BT_SetPointHeight ( t.terrain.TerrainID, t.x, t.z, 0.0 );
}
else
{
ExitPrompt ( "Memblock 1 already exists!","Terrain" ); ExitProcess ( 0 );
}
CloseFile ( 1 );
}
}
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++ VS2019, SQL, PL-SQL, JavaScript, HTML, Three.js, others
Hardware: ULTRA FAST Quad Core Gaming PC Tower WIFI & 16GB 1TB HDD & Win 10 (x64), Geforce GTX1060(3GB). Dell Mixed Reality VR headset, Aerodrums 3D