2011-12-10 13:25:22 +00:00
|
|
|
#ifndef _PAYSAGES_CLOUDS_H_
|
|
|
|
#define _PAYSAGES_CLOUDS_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
2012-01-23 23:45:33 +00:00
|
|
|
#include "noise.h"
|
|
|
|
#include "renderer.h"
|
2011-12-10 13:25:22 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-01-23 23:45:33 +00:00
|
|
|
#define CLOUDS_MAX_LAYERS 6
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double ycenter;
|
|
|
|
double ymin;
|
|
|
|
double ymax;
|
|
|
|
NoiseGenerator* noise;
|
|
|
|
Color color;
|
|
|
|
double scaling;
|
|
|
|
double coverage;
|
2012-01-23 23:45:33 +00:00
|
|
|
} CloudsLayerDefinition;
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-01-23 23:45:33 +00:00
|
|
|
int nblayers;
|
|
|
|
CloudsLayerDefinition layers[CLOUDS_MAX_LAYERS];
|
|
|
|
} CloudsDefinition;
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
void cloudsInit();
|
2012-01-23 23:45:33 +00:00
|
|
|
void cloudsSave(FILE* f, CloudsDefinition* definition);
|
|
|
|
void cloudsLoad(FILE* f, CloudsDefinition* definition);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
CloudsDefinition cloudsCreateDefinition();
|
2012-01-23 23:45:33 +00:00
|
|
|
void cloudsDeleteDefinition(CloudsDefinition* definition);
|
|
|
|
void cloudsCopyDefinition(CloudsDefinition* source, CloudsDefinition* destination);
|
|
|
|
void cloudsValidateDefinition(CloudsDefinition* definition);
|
|
|
|
|
|
|
|
CloudsLayerDefinition cloudsLayerCreateDefinition();
|
|
|
|
void cloudsLayerDeleteDefinition(CloudsLayerDefinition* definition);
|
|
|
|
void cloudsLayerCopyDefinition(CloudsLayerDefinition* source, CloudsLayerDefinition* destination);
|
|
|
|
void cloudsLayerValidateDefinition(CloudsLayerDefinition* definition);
|
|
|
|
|
|
|
|
int cloudsGetLayerCount(CloudsDefinition* definition);
|
|
|
|
CloudsLayerDefinition* cloudsGetLayer(CloudsDefinition* definition, int layer);
|
|
|
|
int cloudsAddLayer(CloudsDefinition* definition);
|
|
|
|
void cloudsDeleteLayer(CloudsDefinition* definition, int layer);
|
|
|
|
|
|
|
|
Color cloudsGetLayerColor(CloudsLayerDefinition* definition, Renderer* renderer, Vector3 start, Vector3 end);
|
|
|
|
Color cloudsGetColor(CloudsDefinition* definition, Renderer* renderer, Vector3 start, Vector3 end);
|
2012-01-24 13:59:54 +00:00
|
|
|
Color cloudsLayerFilterLight(CloudsLayerDefinition* definition, Renderer* renderer, Color light, Vector3 location, Vector3 light_location, Vector3 direction_to_light);
|
|
|
|
Color cloudsFilterLight(CloudsDefinition* definition, Renderer* renderer, Color light, Vector3 location, Vector3 light_location, Vector3 direction_to_light);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
#endif
|