160 {
162 return;
163
165
166
167 int rad = static_cast<int>(mult) / 2;
168
169 for (fl::size j = 0; j < mult; ++j) {
170 for (fl::size i = 0; i < mult; ++i) {
171
172 int dx = static_cast<int>(i) - rad;
173 int dy = static_cast<int>(j) - rad;
174
176 continue;
177 }
178 fl::size xx =
x * mult + i;
179 fl::size yy =
y * mult + j;
180 if (
mSim->has(xx, yy)) {
183 if (pt == 0) {
184
185 pt = v16;
186 } else {
187 const bool sign_matches = (pt >= 0) == (v16 >= 0);
188 if (!sign_matches) {
189
190 pt = v16;
191 } else {
192
193
194 u16 abs_pt =
static_cast<u16
>(
fl::abs(pt));
195 u16 abs_v16 =
static_cast<u16
>(
fl::abs(v16));
196 if (abs_v16 > abs_pt) {
197 pt = v16;
198 }
199 }
200 }
201 } else {
202
203 mSim->seti16(xx, yy, v16);
204 }
205 }
206 }
207 }
208}
fl::Grid< i16 > mChangeGrid
bool has(fl::size x, fl::size y) const
fl::unique_ptr< WaveSimulation2D_Real > mSim
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NOEXCEPT