2013-02-27 16:38:27 +00:00
|
|
|
#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);
|
2013-02-28 15:34:47 +00:00
|
|
|
if (height > renderer->water->definition->height)
|
2013-02-27 16:38:27 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-28 15:34:47 +00:00
|
|
|
/*Renderer* waterCreatePreviewColorRenderer()
|
2013-02-27 16:38:27 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Color waterGetPreviewColor(Renderer* renderer, double x, double y, double scaling)
|
|
|
|
{
|
|
|
|
|
2013-02-28 15:34:47 +00:00
|
|
|
}*/
|