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-01-03 15:40:50 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#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;
|
|
|
|
Color color;
|
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-01-23 23:45:33 +00:00
|
|
|
void texturesSave(FILE* f, TexturesDefinition* definition);
|
|
|
|
void texturesLoad(FILE* f, TexturesDefinition* definition);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
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
|