when i compile the following code without including dbBuildTerrain it works fine but as soon as i include it i get an error!!! By the way the heightmaps and Textures are 512*512 png files
#include "DarkGDK.h";
#include "string.h";
#include "windows.h";
.//Lots of Constants Here
.
.
.
.
.
.
void DarkGDK ( void )
{
char continent[11];
if (strcmp(dbCL(),"")==0 ){
strcpy(continent,dbCL());
}else
{
strcpy(continent,"Ă„ustralia");
}
dbSyncOn();
dbSyncRate(1000);dbCLS();
dbMakeObjectTerrain(1); // make a new terrain
char loadthis[MAX_PATH];
strcpy(loadthis,"graphics\\"); strcat(loadthis,continent); strcat(loadthis,"Height.png");
dbSetTerrainHeightmap(1,loadthis); // set the terrain height map
dbSetTerrainScale(1,2,0.6f,2); // set the scale
dbSetTerrainSplit(1,16); // set the split value
dbSetTerrainTiling(1,2); // set the detail tiling
dbSetTerrainLight(1,1.0f,-0.25f,0.0f,1,1,0.78f,0.5f); // set the light
strcpy(loadthis,"graphics\\"); strcat(loadthis,continent); strcat(loadthis,"Texture.png");
dbLoadImage(loadthis,1000,0);
dbLoadImage("graphics\\detail.tga",1001,0);
dbSetTerrainTexture(1,1000,1001); // Set The Terrain Textures
dbBuildTerrain(1);
dbSync();
while (LoopGDK())
{
dbSync ( );
}
}
The Error Message is as follows
Unhandled exception at 0x00000000 in Scudlaunch.exe: 0xC0000005: Access violation reading location 0x00000000.
fubar