Michaël Lemaire
e8b3468038
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@527 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
44 lines
923 B
C
44 lines
923 B
C
#include "private.h"
|
|
|
|
#include "../terrain/public.h"
|
|
#include "../renderer.h"
|
|
#include "../tools.h"
|
|
|
|
Renderer* waterCreatePreviewCoverageRenderer()
|
|
{
|
|
return terrainCreatePreviewRenderer();
|
|
}
|
|
|
|
Color waterGetPreviewCoverage(Renderer* renderer, double x, double y, double scaling, int highlight_enabled)
|
|
{
|
|
double height;
|
|
|
|
height = renderer->terrain->getHeight(renderer, x, y, 1);
|
|
if (height > renderer->water->definition.height)
|
|
{
|
|
return terrainGetPreviewColor(renderer, x, y, scaling);
|
|
}
|
|
else
|
|
{
|
|
Color base;
|
|
|
|
base = renderer->water->getResult(renderer, x, y).final;
|
|
|
|
if (highlight_enabled)
|
|
{
|
|
Color mask = {0.5, 0.5, 1.0, 0.5};
|
|
colorMask(&base, &mask);
|
|
}
|
|
|
|
return base;
|
|
}
|
|
}
|
|
|
|
Renderer* waterCreatePreviewColorRenderer()
|
|
{
|
|
}
|
|
|
|
Color waterGetPreviewColor(Renderer* renderer, double x, double y, double scaling)
|
|
{
|
|
|
|
}
|