| 84 | } |
| 85 | |
| 86 | i16 WaveSimulation2D::geti16(fl::size x, fl::size y) const { |
| 87 | if (!has(x, y)) |
| 88 | return 0; |
| 89 | i32 sum = 0; |
| 90 | u8 mult = fl::max(1, mMultiplier); |
| 91 | for (u32 j = 0; j < mult; ++j) { |
| 92 | for (u32 i = 0; i < mult; ++i) { |
| 93 | u32 xx = x * mult + i; |
| 94 | u32 yy = y * mult + j; |
| 95 | i32 pt = mSim->geti16(xx, yy); |
| 96 | if (mUseChangeGrid) { |
| 97 | // i32 ch_pt = mChangeGrid[(yy * mMultiplier) + xx]; |
| 98 | i32 ch_pt = mChangeGrid(xx, yy); |
| 99 | if (ch_pt != 0) { // we got a hit. |
| 100 | sum += ch_pt; |
| 101 | } else { |
| 102 | sum += pt; |
| 103 | } |
| 104 | } else { |
| 105 | sum += pt; |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | i16 out = static_cast<i16>(sum / (mult * mult)); |
| 110 | return out; |
| 111 | } |
| 112 | |
| 113 | i16 WaveSimulation2D::geti16Previous(fl::size x, fl::size y) const { |
| 114 | if (!has(x, y)) |
no test coverage detected