Hi people,
I'm having a problem with the content processor. My setup is a "lib"-project containing all of my engine-parts, and a "windows"-application project. and now i inserted a "content extention" like it was said in the sample "HeightmapCollision".
the content writer
[ContentTypeWriter]
public class HeightMapInfoWriter : ContentTypeWriter<HeightMapInfoContent>
{
protected override void Write(ContentWriter output, HeightMapInfoContent value)
{
output.Write(value.TerrainScale);
output.Write(value.Height.GetLength(0));
output.Write(value.Height.GetLength(1));
foreach (float height in value.Height)
{
output.Write(height);
}
}
public override string GetRuntimeType(TargetPlatform targetPlatform)
{
return base.GetRuntimeType(targetPlatform);
}
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return typeof(HeightMapInfoReader).AssemblyQualifiedName;
}
}
and the contentReader
public class HeightMapInfoReader : ContentTypeReader<HeightMapInfo>
{
protected override HeightMapInfo Read(ContentReader input,
HeightMapInfo existingInstance)
{
float terrainScale = input.ReadSingle();
int width = input.ReadInt32();
int height = input.ReadInt32();
float[,] heights = new float[width, height];
for (int x = 0; x < width; x++)
{
for (int z = 0; z < height; z++)
{
heights[x, z] = input.ReadSingle();
}
}
return new HeightMapInfo(heights, terrainScale);
}
}
And in the "windows application" i've added a reference for the content, changed the processor to the newly created terrain processor... and uess what?...
It doesn't work :(
At runtime it clames not to be able to find the reader???
In several forums, there where several answers and none was relevant for my problem (tried them all)
So hopefully there can be a conclusive answer on this matter, the one states that the reader and writer can live side by side in the same lib project... why????
Hopefully someone can help me out with this...
greetz