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