Definition at line 152 of file wave_simulation.cpp.
152 {
154 return;
155
157
158
159 int rad = static_cast<int>(mult) / 2;
160
161 for (fl::size j = 0; j < mult; ++j) {
162 for (fl::size i = 0; i < mult; ++i) {
163
164 int dx = static_cast<int>(i) - rad;
165 int dy = static_cast<int>(j) - rad;
166
167 if (
ABS(dx) +
ABS(dy) > rad) {
168 continue;
169 }
170 fl::size xx =
x * mult + i;
171 fl::size yy =
y * mult + j;
172 if (
mSim->has(xx, yy)) {
175 if (pt == 0) {
176
177 pt = v16;
178 } else {
179 const bool sign_matches = (pt >= 0) == (v16 >= 0);
180 if (!sign_matches) {
181
182 pt = v16;
183 } else {
184
185
186 u16 abs_pt =
static_cast<u16
>(
ABS(pt));
187 u16 abs_v16 =
static_cast<u16
>(
ABS(v16));
188 if (abs_v16 > abs_pt) {
189 pt = v16;
190 }
191 }
192 }
193 } else {
194
195 mSim->seti16(xx, yy, v16);
196 }
197 }
198 }
199 }
200}
fl::Grid< i16 > mChangeGrid
bool has(fl::size x, fl::size y) const
fl::unique_ptr< WaveSimulation2D_Real > mSim
References ABS, has(), MAX, mChangeGrid, mMultiplier, mSim, mUseChangeGrid, x, and y.
Referenced by setf().