| 95 | |
| 96 | |
| 97 | bool Animation_Plasma::Play(HyperImage& painter) |
| 98 | { |
| 99 | bool ret = true; |
| 100 | |
| 101 | auto mod = start++; |
| 102 | for (int y = 0; y < PLASMA_HEIGHT; y++) |
| 103 | for (int x = 0; x < PLASMA_WIDTH; x++) { |
| 104 | int delta = y * PLASMA_WIDTH; |
| 105 | int palIndex = int((plasma[delta + x] + mod) % PAL_LEN) * 3; |
| 106 | |
| 107 | painter.setPen(ColorRgb(pal[palIndex], pal[palIndex + 1], pal[palIndex + 2])); |
| 108 | painter.drawPoint(x, y); |
| 109 | } |
| 110 | return ret; |
| 111 | } |
| 112 | |
| 113 | |
| 114 | bool Animation_Plasma::isRegistered = hyperhdr::effects::REGISTER_EFFECT(Animation_Plasma::getDefinition()); |