MCPcopy Create free account
hub / github.com/Theverat/NormalmapGenerator / handleEdges

Method handleEdges

src_generators/normalmapgenerator.cpp:142–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142int NormalmapGenerator::handleEdges(int iterator, int maxValue) const {
143 if(iterator >= maxValue) {
144 //move iterator from end to beginning + overhead
145 if(tileable)
146 return maxValue - iterator;
147 else
148 return maxValue - 1;
149 }
150 else if(iterator < 0) {
151 //move iterator from beginning to end - overhead
152 if(tileable)
153 return maxValue + iterator;
154 else
155 return 0;
156 }
157 else {
158 return iterator;
159 }
160}
161
162//transform -1..1 to 0..255
163int NormalmapGenerator::mapComponent(double value) const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected