2013-11-15 22:26:44 +00:00
|
|
|
#include "CloudsDefinition.h"
|
|
|
|
|
|
|
|
#include "CloudLayerDefinition.h"
|
|
|
|
|
2015-11-20 00:07:31 +00:00
|
|
|
static DefinitionNode *_layerConstructor(Layers *parent, const std::string &name) {
|
|
|
|
return new CloudLayerDefinition(parent, name);
|
2013-11-15 22:26:44 +00:00
|
|
|
}
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
CloudsDefinition::CloudsDefinition(DefinitionNode *parent) : Layers(parent, "clouds", _layerConstructor) {
|
2013-11-15 22:26:44 +00:00
|
|
|
}
|
|
|
|
|
2015-12-10 18:40:39 +00:00
|
|
|
void CloudsDefinition::applyPreset(CloudsPreset preset, RandomGenerator &random) {
|
2013-11-15 22:26:44 +00:00
|
|
|
clear();
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
if (preset == CLOUDS_PRESET_PARTLY_CLOUDY) {
|
2015-11-20 00:07:31 +00:00
|
|
|
CloudLayerDefinition layer(NULL, "Strato-cumulus");
|
|
|
|
layer.type = CloudLayerDefinition::STRATOCUMULUS;
|
2015-12-10 18:40:39 +00:00
|
|
|
layer.noise_state.randomizeOffsets(random);
|
2013-11-15 22:26:44 +00:00
|
|
|
addLayer(layer);
|
|
|
|
}
|
|
|
|
}
|