5 #include "TileShader.h"
14 TileShader::TileShader() =
default;
16 TileShader::~TileShader() =
default;
25 ColorT * sdata = surface.
getData();
28 auto I = m_subShaders.begin();
29 auto Iend = m_subShaders.end();
30 for (; I != Iend; ++I) {
31 if (!I->second->checkIntersect(surface.
getSegment())) {
34 auto subs = I->second->newSurface(surface.
getSegment());
37 ColorT * subsdata = subs->getData();
38 auto channels = subs->getChannels();
40 for (
unsigned int i = 0; i < sdata_len; ++i) {
41 if (subsdata[i * channels + channels - 1] > 127) {
unsigned int getSize() const
Accessor for the size of segment, m_res + 1.
DataType * getData()
Accessor for a pointer to buffer containing data values.
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Data store for terrain surface data.
const Segment & getSegment() const
Accessor for the terrain height segment this surface is associated with.
void shade(Surface &) const override
Populate a Surface with data.
bool checkIntersect(const Segment &) const override
Check whether this Shader has any effect on the given Segment.