144 {
146 return;
147
149
150
151 int rad = static_cast<int>(mult) / 2;
152
153 for (size_t j = 0; j < mult; ++j) {
154 for (size_t i = 0; i < mult; ++i) {
155
156 int dx = static_cast<int>(i) - rad;
157 int dy = static_cast<int>(j) - rad;
158
159 if (
ABS(dx) +
ABS(dy) > rad) {
160 continue;
161 }
162 size_t xx =
x * mult + i;
163 size_t yy =
y * mult + j;
164 if (
mSim->has(xx, yy)) {
166 if (pt == 0) {
167
168 pt = v16;
169 } else {
170 const bool sign_matches = (pt >= 0) == (v16 >= 0);
171 if (!sign_matches) {
172
173 pt = v16;
174 } else {
175
176
177 uint16_t abs_pt =
static_cast<uint16_t
>(
ABS(pt));
178 uint16_t abs_v16 =
static_cast<uint16_t
>(
ABS(v16));
179 if (abs_v16 > abs_pt) {
180 pt = v16;
181 }
182 }
183 }
184 }
185 }
186 }
187}
fl::Grid< int16_t > mChangeGrid
fl::scoped_ptr< WaveSimulation2D_Real > mSim
bool has(size_t x, size_t y) const