| 111 | { |
| 112 | public: |
| 113 | Surround() : Effect("Surround / Attenuation") |
| 114 | { |
| 115 | m_listener.setPosition({(windowWidth - 20.f) / 2.f, (windowHeight - 20.f) / 2.f}); |
| 116 | m_listener.setFillColor(sf::Color::Red); |
| 117 | |
| 118 | // Load the music file |
| 119 | if (!m_music.openFromFile(resourcesDir() / "doodle_pop.ogg")) |
| 120 | { |
| 121 | std::cerr << "Failed to load " << (resourcesDir() / "doodle_pop.ogg").string() << std::endl; |
| 122 | std::abort(); |
| 123 | } |
| 124 | |
| 125 | // Set the music to loop |
| 126 | m_music.setLooping(true); |
| 127 | |
| 128 | // Set attenuation to a nice value |
| 129 | m_music.setAttenuation(0.04f); |
| 130 | } |
| 131 | |
| 132 | void onUpdate(float /*time*/, float x, float y) override |
| 133 | { |
nothing calls this directly
no test coverage detected