Hi,
So I am making a map editor for my game, I am using the following code:
Under HandleUpdate
if (input->GetKeyPress(KEY_H)) {
PaintBrush(Vector3::LEFT, 5);
}
the function
[code]void CharacterDemo::PaintBrush(Vector3 center, int radius) {
ResourceCache* cache = GetSubsystem();
Color pixel = cache->GetResource<Image>("Textures/MAP.png")->GetPixel(1, 1);
float lightness = pixel.Lightness();
Color newColor = Color(217, 217, 217);
cache->GetResource<Image>("Textures/MAP.png")->SetPixel(1000, 1000, Color(500,0,0));
Terrain* terrain = terrainNode->GetComponent<Terrain>();
terrain->ApplyHeightMap();
}[/code]
terrainNode is a public shared pointer
but whenever I press H I get the assertion failed error.
Does anyone know of a way to do this?
Many thanks!