2012-01-03 15:40:50 +00:00
|
|
|
#ifndef _PAYSAGES_TEXTURES_H_
|
|
|
|
#define _PAYSAGES_TEXTURES_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
2012-01-23 23:45:33 +00:00
|
|
|
#include "noise.h"
|
2012-01-22 22:06:11 +00:00
|
|
|
#include "lighting.h"
|
2012-04-22 17:12:39 +00:00
|
|
|
#include "pack.h"
|
2012-01-03 15:40:50 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-01-23 23:45:33 +00:00
|
|
|
#define TEXTURES_MAX_LAYERS 50
|
|
|
|
|
2012-01-03 15:40:50 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Zone* zone;
|
|
|
|
NoiseGenerator* bump_noise;
|
2012-04-03 19:33:40 +00:00
|
|
|
double bump_scaling;
|
|
|
|
double bump_height;
|
|
|
|
SurfaceMaterial material;
|
2012-01-23 23:45:33 +00:00
|
|
|
} TextureLayerDefinition;
|
2012-01-03 15:40:50 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-01-23 23:45:33 +00:00
|
|
|
int nbtextures;
|
|
|
|
TextureLayerDefinition textures[TEXTURES_MAX_LAYERS];
|
|
|
|
} TexturesDefinition;
|
2012-01-03 15:40:50 +00:00
|
|
|
|
|
|
|
void texturesInit();
|
2012-02-12 16:57:29 +00:00
|
|
|
void texturesQuit();
|
2012-04-22 17:12:39 +00:00
|
|
|
void texturesSave(PackStream* stream, TexturesDefinition* definition);
|
|
|
|
void texturesLoad(PackStream* stream, TexturesDefinition* definition);
|
2012-01-23 23:45:33 +00:00
|
|
|
|
|
|
|
TexturesDefinition texturesCreateDefinition();
|
|
|
|
void texturesDeleteDefinition(TexturesDefinition* definition);
|
|
|
|
void texturesCopyDefinition(TexturesDefinition* source, TexturesDefinition* destination);
|
|
|
|
void texturesValidateDefinition(TexturesDefinition* definition);
|
|
|
|
|
|
|
|
TextureLayerDefinition texturesLayerCreateDefinition();
|
|
|
|
void texturesLayerDeleteDefinition(TextureLayerDefinition* definition);
|
|
|
|
void texturesLayerCopyDefinition(TextureLayerDefinition* source, TextureLayerDefinition* destination);
|
|
|
|
void texturesLayerValidateDefinition(TextureLayerDefinition* definition);
|
|
|
|
|
|
|
|
int texturesGetLayerCount(TexturesDefinition* definition);
|
|
|
|
TextureLayerDefinition* texturesGetLayer(TexturesDefinition* definition, int layer);
|
|
|
|
int texturesAddLayer(TexturesDefinition* definition);
|
|
|
|
void texturesDeleteLayer(TexturesDefinition* definition, int layer);
|
|
|
|
|
2012-04-05 17:47:43 +00:00
|
|
|
double texturesGetLayerCoverage(TextureLayerDefinition* definition, Renderer* renderer, Vector3 location, double detail);
|
2012-01-23 23:45:33 +00:00
|
|
|
Color texturesGetLayerColor(TextureLayerDefinition* definition, Renderer* renderer, Vector3 location, double detail);
|
2012-01-24 13:16:20 +00:00
|
|
|
Color texturesGetColor(TexturesDefinition* definition, Renderer* renderer, Vector3 location, double detail);
|
2012-01-03 15:40:50 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|