| 506 | // --------------------------------------------------------------------------- |
| 507 | |
| 508 | FlowFieldFP::FlowFieldFP(const XYMap &xyMap, const Params ¶ms) |
| 509 | : FlowField(xyMap, params) { |
| 510 | int w = (int)getWidth(); |
| 511 | int h = (int)getHeight(); |
| 512 | |
| 513 | mState.init(w, h); |
| 514 | initPerm256(mPermX, 42); |
| 515 | initPerm256(mPermY, 1337); |
| 516 | syncParams(); |
| 517 | if (!mState.fade_lut_initialized) { |
| 518 | perlin_s16x16::init_fade_lut(mState.fade_lut); |
| 519 | mState.fade_lut_initialized = true; |
| 520 | } |
| 521 | |
| 522 | } |
| 523 | |
| 524 | void FlowFieldFP::syncParams() { |
| 525 | mColorShift_fp = s16x16(mParams.color_shift); |